public override string AsGml(DbGeometry geometryValue)
        {
            CheckParameterNotNull("geometryValue", geometryValue);

            dynamic providerValue = geometryValue.ProviderValue;
            return providerValue.AsGml().Value;
        }
        public override DbGeometry Buffer(DbGeometry geometryValue, double distance)
        {
            CheckParameterNotNull("geometryValue", geometryValue);

            dynamic providerValue = geometryValue.ProviderValue;
            return GeometryFromProviderValue(providerValue.STBuffer(distance));
        }
        public override string AsText(DbGeometry geometryValue)
        {
            CheckParameterNotNull("geometryValue", geometryValue);

            dynamic providerValue = geometryValue.ProviderValue;
            return providerValue.STAsText().ToSqlString().Value;
        }
        public override byte[] AsBinary(DbGeometry geometryValue)
        {
            CheckParameterNotNull("geographyValue", geometryValue);

            dynamic providerValue = geometryValue.ProviderValue;
            return providerValue.STAsBinary().Value;
        }
예제 #5
0
    public override string AsText(DbGeometry geometryValue)
    {
      if (geometryValue == null)
        throw new ArgumentNullException("geometryValue");

      var providerValue = new MySqlGeometry();
      MySqlGeometry.TryParse(geometryValue.ProviderValue.ToString(), out providerValue);

      return providerValue.ToString();
    }
예제 #6
0
 private static ReadOnlySpatialValues CheckCompatible(DbGeometry geometryValue)
 {
     Debug.Assert(geometryValue != null, "Validate geometryValue is non-null before calling CheckCompatible");
     if (geometryValue != null)
     {
         ReadOnlySpatialValues expectedValue = geometryValue.ProviderValue as ReadOnlySpatialValues;
         if (expectedValue != null)
         {
             return expectedValue;
         }
     }
     throw SpatialExceptions.GeometryValueNotCompatibleWithSpatialServices("geometryValue");
 }
예제 #7
0
 public override DbGeometry InteriorRingAt(DbGeometry geometryValue, int index)
 {
     throw SpatialServicesUnavailable();
 }
예제 #8
0
 public override DbGeometry GetExteriorRing(DbGeometry geometryValue)
 {
     throw SpatialServicesUnavailable();
 }
예제 #9
0
 public override DbGeometry GetCentroid(DbGeometry geometryValue)
 {
     throw SpatialServicesUnavailable();
 }
예제 #10
0
 public override DbGeometry PointAt(DbGeometry geometryValue, int index)
 {
     throw SpatialServicesUnavailable();
 }
예제 #11
0
 public override bool? GetIsRing(DbGeometry geometryValue)
 {
     throw SpatialServicesUnavailable();
 }
예제 #12
0
 public override byte[] AsBinary(DbGeometry geometryValue)
 {
     geometryValue.CheckNull("geometryValue");
     ReadOnlySpatialValues expectedValue = CheckCompatible(geometryValue);
     return expectedValue.CloneBinary();
 }
예제 #13
0
 public override string GetSpatialTypeName(DbGeometry geometryValue)
 {
     throw SpatialServicesUnavailable();
 }
예제 #14
0
 public override DbGeometry GetEnvelope(DbGeometry geometryValue)
 {
     throw SpatialServicesUnavailable();
 }
예제 #15
0
 public override int GetDimension(DbGeometry geometryValue)
 {
     throw SpatialServicesUnavailable();
 }
예제 #16
0
 public override DbGeometry SymmetricDifference(DbGeometry geometryValue, DbGeometry otherGeometry)
 {
     throw SpatialServicesUnavailable();
 }
예제 #17
0
 public override double? GetYCoordinate(DbGeometry geometryValue)
 {
     throw SpatialServicesUnavailable();
 }
예제 #18
0
 public override string AsGml(DbGeometry geometryValue)
 {
     geometryValue.CheckNull("geometryValue");
     ReadOnlySpatialValues expectedValue = CheckCompatible(geometryValue);
     return expectedValue.GML;
 }
예제 #19
0
 public override DbGeometry GetStartPoint(DbGeometry geometryValue)
 {
     throw SpatialServicesUnavailable();
 }
예제 #20
0
 public override bool Overlaps(DbGeometry geometryValue, DbGeometry otherGeometry)
 {
     throw SpatialServicesUnavailable();
 }
예제 #21
0
 public override int? GetPointCount(DbGeometry geometryValue)
 {
     throw SpatialServicesUnavailable();
 }
예제 #22
0
 public override bool Relate(DbGeometry geometryValue, DbGeometry otherGeometry, string matrix)
 {
     throw SpatialServicesUnavailable();
 }
예제 #23
0
 public override double? GetArea(DbGeometry geometryValue)
 {
     throw SpatialServicesUnavailable();
 }
예제 #24
0
 public override DbGeometry Buffer(DbGeometry geometryValue, double distance)
 {
     throw SpatialServicesUnavailable();
 }
예제 #25
0
 public override DbGeometry GetPointOnSurface(DbGeometry geometryValue)
 {
     throw SpatialServicesUnavailable();
 }
예제 #26
0
 public override double Distance(DbGeometry geometryValue, DbGeometry otherGeometry)
 {
     throw SpatialServicesUnavailable();
 }
예제 #27
0
 public override int? GetInteriorRingCount(DbGeometry geometryValue)
 {
     throw SpatialServicesUnavailable();
 }
예제 #28
0
 public override DbGeometry GetConvexHull(DbGeometry geometryValue)
 {
     throw SpatialServicesUnavailable();
 }
예제 #29
0
        public static object ConvertToSqlTypesGeometry(DbGeometry geometry)
        {
            var providerValue = geometry.ProviderValue;
            if (providerValue == null || providerValue.GetType() == SqlGeometryType)
            {
                return providerValue;
            }

            // DbGeography value created by a different spatial services
            throw new NotSupportedException("DbGeometry values not backed by Sql Server spatial types are not supported.");
        }
예제 #30
0
 public override DbGeometry Union(DbGeometry geometryValue, DbGeometry otherGeometry)
 {
     throw SpatialServicesUnavailable();
 }