public override string AsText(DbGeography geographyValue) { CheckParameterNotNull("geographyValue", geographyValue); dynamic providerValue = geographyValue.ProviderValue; return providerValue.STAsText().ToSqlString().Value; }
public override DbGeography Buffer(DbGeography geographyValue, double distance) { CheckParameterNotNull("geographyValue", geographyValue); dynamic providerValue = geographyValue.ProviderValue; return GeographyFromProviderValue(providerValue.STBuffer(distance)); }
public override byte[] AsBinary(DbGeography geographyValue) { CheckParameterNotNull("geographyValue", geographyValue); dynamic providerValue = geographyValue.ProviderValue; return providerValue.STAsBinary().Value; }
public override string AsGml(DbGeography geographyValue) { CheckParameterNotNull("geographyValue", geographyValue); dynamic providerValue = geographyValue.ProviderValue; return providerValue.AsGml().Value; }
private static ReadOnlySpatialValues CheckCompatible(DbGeography geographyValue) { Debug.Assert(geographyValue != null, "Validate geographyValue is non-null before calling CheckCompatible"); if (geographyValue != null) { ReadOnlySpatialValues expectedValue = geographyValue.ProviderValue as ReadOnlySpatialValues; if (expectedValue != null) { return expectedValue; } } throw SpatialExceptions.GeographyValueNotCompatibleWithSpatialServices("geographyValue"); }
public override bool GetIsEmpty(DbGeography geographyValue) { throw SpatialServicesUnavailable(); }
public override int GetDimension(DbGeography geographyValue) { throw SpatialServicesUnavailable(); }
public override DbGeographyWellKnownValue CreateWellKnownValue(DbGeography geographyValue) { geographyValue.CheckNull("geographyValue"); ReadOnlySpatialValues backingValue = CheckCompatible(geographyValue); return new DbGeographyWellKnownValue() { CoordinateSystemId = backingValue.CoordinateSystemId, WellKnownBinary = backingValue.CloneBinary(), WellKnownText = backingValue.Text }; }
/// <summary> /// Returns a nullable double value that indicates the area of the given <see cref="DbGeography"/> value, which may be null if the value does not represent a surface. /// <param name="geographyValue">The geography value, which need not represent a surface.</param> /// <returns>The area of <paramref name="geographyValue"/>, if it represents a surface; otherwise <c>null</c>.</returns> /// </summary> /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception> /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception> public abstract double? GetArea(DbGeography geographyValue);
/// <summary> /// Returns the number of points in the given <see cref="DbGeography"/> value, if it represents a linestring or linear ring. /// <param name="geographyValue">The geography value, which need not represent a linestring or linear ring.</param> /// <returns>The number of elements in <paramref name="geographyValue"/>, if it represents a linestring or linear ring; otherwise <c>null</c>.</returns> /// </summary> /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception> /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception> public abstract int? GetPointCount(DbGeography geographyValue);
public override DbGeography SymmetricDifference(DbGeography geographyValue, DbGeography otherGeography) { throw SpatialServicesUnavailable(); }
public override DbGeography Buffer(DbGeography geographyValue, double distance) { throw SpatialServicesUnavailable(); }
public override double Distance(DbGeography geographyValue, DbGeography otherGeography) { throw SpatialServicesUnavailable(); }
public override bool Disjoint(DbGeography geographyValue, DbGeography otherGeography) { throw SpatialServicesUnavailable(); }
public override bool Intersects(DbGeography geographyValue, DbGeography otherGeography) { throw SpatialServicesUnavailable(); }
public override string GetSpatialTypeName(DbGeography geographyValue) { throw SpatialServicesUnavailable(); }
public override string AsGml(DbGeography geographyValue) { geographyValue.CheckNull("geographyValue"); ReadOnlySpatialValues expectedValue = CheckCompatible(geographyValue); return expectedValue.GML; }
public override DbGeography Union(DbGeography geographyValue, DbGeography otherGeography) { throw SpatialServicesUnavailable(); }
/// <summary> /// Computes the symmetric difference of this DbGeography value and another DbGeography value. /// </summary> /// <param name="other">The geography value for which the symmetric difference with this value should be computed.</param> /// <returns>A new DbGeography value representing the symmetric difference between this geography value and <paramref name="other"/>.</returns> /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception> public DbGeography SymmetricDifference(DbGeography other) { other.CheckNull("other"); return(this.spatialSvcs.SymmetricDifference(this, other)); }
/// <summary> /// Computes the intersection of this DbGeography value and another DbGeography value. /// </summary> /// <param name="other">The geography value for which the intersection with this value should be computed.</param> /// <returns>A new DbGeography value representing the intersection between this geography value and <paramref name="other"/>.</returns> /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception> public DbGeography Intersection(DbGeography other) { other.CheckNull("other"); return(this.spatialSvcs.Intersection(this, other)); }
public override DbGeography GetStartPoint(DbGeography geographyValue) { throw SpatialServicesUnavailable(); }
/// <summary> /// Determines whether this DbGeography is spatially disjoint from the specified DbGeography argument. /// </summary> /// <param name="other">The geography value that should be compared with this geography value for disjointness.</param> /// <returns><c>true</c> if <paramref name="other"/> is disjoint from this geography value; otherwise <c>false</c>.</returns> /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception> public bool Disjoint(DbGeography other) { other.CheckNull("other"); return(this.spatialSvcs.Disjoint(this, other)); }
public override bool?GetIsClosed(DbGeography geographyValue) { throw SpatialServicesUnavailable(); }
/// <summary> /// Returns a point element of the given <see cref="DbGeography"/> value, if it represents a linestring or linear ring. /// <param name="geographyValue">The geography value, which need not represent a linestring or linear ring.</param> /// <param name="index">The position within the geography value from which the element should be taken.</param> /// <returns>The point in <paramref name="geographyValue"/> at position <paramref name="index"/>, if it represents a linestring or linear ring; otherwise <c>null</c>.</returns> /// </summary> /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception> /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception> public abstract DbGeography PointAt(DbGeography geographyValue, int index);
public override int?GetPointCount(DbGeography geographyValue) { throw SpatialServicesUnavailable(); }
/// <summary> /// Creates an instance of <see cref="DbGeographyWellKnownValue"/> that represents the specified <see cref="DbGeography"/> value using one or both of the standard well known spatial formats. /// </summary> /// <param name="geographyValue"></param> /// <returns>The well known representation of <paramref name="geographyValue"/>, as a new <see cref="DbGeographyWellKnownValue"/>.</returns> /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception> /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception> public abstract DbGeographyWellKnownValue CreateWellKnownValue(DbGeography geographyValue);
public override DbGeography PointAt(DbGeography geographyValue, int index) { throw SpatialServicesUnavailable(); }
public override int GetCoordinateSystemId(DbGeography geographyValue) { geographyValue.CheckNull("geographyValue"); ReadOnlySpatialValues backingValue = CheckCompatible(geographyValue); return backingValue.CoordinateSystemId; }
public override double?GetArea(DbGeography geographyValue) { throw SpatialServicesUnavailable(); }
public override byte[] AsBinary(DbGeography geographyValue) { geographyValue.CheckNull("geographyValue"); ReadOnlySpatialValues expectedValue = CheckCompatible(geographyValue); return expectedValue.CloneBinary(); }
/// <summary> /// Computes the union of this DbGeography value and another DbGeography value. /// </summary> /// <param name="other">The geography value for which the union with this value should be computed.</param> /// <returns>A new DbGeography value representing the union between this geography value and <paramref name="other"/>.</returns> /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception> public DbGeography Union(DbGeography other) { other.CheckNull("other"); return(this.spatialSvcs.Union(this, other)); }
public override bool? GetIsClosed(DbGeography geographyValue) { throw SpatialServicesUnavailable(); }
/// <summary> /// Computes the distance between the closest points in this DbGeography value and another DbGeography value. /// </summary> /// <param name="other">The geography value for which the distance from this value should be computed.</param> /// <returns>A double value that specifies the distance between the two closest points in this geography value and <paramref name="other"/>.</returns> /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception> public double?Distance(DbGeography other) { other.CheckNull("other"); return(this.spatialSvcs.Distance(this, other)); }
public override int? GetPointCount(DbGeography geographyValue) { throw SpatialServicesUnavailable(); }
/// <summary> /// Returns a <see cref="DbGeography"/> value that represents the end point of the given DbGeography value, which may be null if the value does not represent a curve. /// <param name="geographyValue">The geography value, which need not represent a curve.</param> /// <returns>The end point of <paramref name="geographyValue"/>, if it represents a curve; otherwise <c>null</c>.</returns> /// </summary> /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception> /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception> public abstract DbGeography GetEndPoint(DbGeography geographyValue);
public override double? GetArea(DbGeography geographyValue) { throw SpatialServicesUnavailable(); }
/// <summary> /// Returns a nullable Boolean value that whether the given <see cref="DbGeography"/> value is closed, which may be null if the value does not represent a curve. /// <param name="geographyValue">The geography value, which need not represent a curve.</param> /// <returns><c>true</c> if <paramref name="geographyValue"/> represents a closed curve; <c>false</c> if <paramref name="geographyValue"/> represents a curve that is not closed; otherwise <c>null</c>.</returns> /// </summary> /// <exception cref="ArgumentNullException"><paramref name="geographyValue"/> is null.</exception> /// <exception cref="ArgumentException"><paramref name="geographyValue"/> is not compatible with this spatial services implementation.</exception> public abstract bool? GetIsClosed(DbGeography geographyValue);
public static object ConvertToSqlTypesGeography(DbGeography geography) { Debug.Assert(geography != null, "geography != null"); var providerValue = geography.ProviderValue; if (providerValue == null || providerValue.GetType() == SqlGeographyType) { return providerValue; } // DbGeography value created by a different spatial services throw new NotSupportedException("DbGeography values not backed by Sql Server spatial types are not supported."); }
/// <summary> /// Determines whether this DbGeography is spatially equal to the specified DbGeography argument. /// </summary> /// <param name="other">The geography value that should be compared with this geography value for equality.</param> /// <returns><c>true</c> if <paramref name="other"/> is spatially equal to this geography value; otherwise <c>false</c>.</returns> /// <exception cref="ArgumentNullException"><paramref name="other"/> is null.</exception> public bool SpatialEquals(DbGeography other) { other.CheckNull("other"); return(this.spatialSvcs.SpatialEquals(this, other)); }