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; }
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(); }
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"); }
public override DbGeometry InteriorRingAt(DbGeometry geometryValue, int index) { throw SpatialServicesUnavailable(); }
public override DbGeometry GetExteriorRing(DbGeometry geometryValue) { throw SpatialServicesUnavailable(); }
public override DbGeometry GetCentroid(DbGeometry geometryValue) { throw SpatialServicesUnavailable(); }
public override DbGeometry PointAt(DbGeometry geometryValue, int index) { throw SpatialServicesUnavailable(); }
public override bool? GetIsRing(DbGeometry geometryValue) { throw SpatialServicesUnavailable(); }
public override byte[] AsBinary(DbGeometry geometryValue) { geometryValue.CheckNull("geometryValue"); ReadOnlySpatialValues expectedValue = CheckCompatible(geometryValue); return expectedValue.CloneBinary(); }
public override string GetSpatialTypeName(DbGeometry geometryValue) { throw SpatialServicesUnavailable(); }
public override DbGeometry GetEnvelope(DbGeometry geometryValue) { throw SpatialServicesUnavailable(); }
public override int GetDimension(DbGeometry geometryValue) { throw SpatialServicesUnavailable(); }
public override DbGeometry SymmetricDifference(DbGeometry geometryValue, DbGeometry otherGeometry) { throw SpatialServicesUnavailable(); }
public override double? GetYCoordinate(DbGeometry geometryValue) { throw SpatialServicesUnavailable(); }
public override string AsGml(DbGeometry geometryValue) { geometryValue.CheckNull("geometryValue"); ReadOnlySpatialValues expectedValue = CheckCompatible(geometryValue); return expectedValue.GML; }
public override DbGeometry GetStartPoint(DbGeometry geometryValue) { throw SpatialServicesUnavailable(); }
public override bool Overlaps(DbGeometry geometryValue, DbGeometry otherGeometry) { throw SpatialServicesUnavailable(); }
public override int? GetPointCount(DbGeometry geometryValue) { throw SpatialServicesUnavailable(); }
public override bool Relate(DbGeometry geometryValue, DbGeometry otherGeometry, string matrix) { throw SpatialServicesUnavailable(); }
public override double? GetArea(DbGeometry geometryValue) { throw SpatialServicesUnavailable(); }
public override DbGeometry Buffer(DbGeometry geometryValue, double distance) { throw SpatialServicesUnavailable(); }
public override DbGeometry GetPointOnSurface(DbGeometry geometryValue) { throw SpatialServicesUnavailable(); }
public override double Distance(DbGeometry geometryValue, DbGeometry otherGeometry) { throw SpatialServicesUnavailable(); }
public override int? GetInteriorRingCount(DbGeometry geometryValue) { throw SpatialServicesUnavailable(); }
public override DbGeometry GetConvexHull(DbGeometry geometryValue) { throw SpatialServicesUnavailable(); }
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."); }
public override DbGeometry Union(DbGeometry geometryValue, DbGeometry otherGeometry) { throw SpatialServicesUnavailable(); }