DbSpatialServices Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before itâ€™s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A providerindependent service API for geospatial (Geometry/Geography) type support.
[System.Serializable]
public abstract class DbSpatialServices
type DbSpatialServices = class
Public MustInherit Class DbSpatialServices
 Inheritance

DbSpatialServices
 Derived
 Attributes
Constructors
DbSpatialServices() 
Properties
Default 
Gets the default services for the DbSpatialServices. 
NativeTypesAvailable 
Override this property to allow the spatial provider to fail fast when native types or other
resources needed for the spatial provider to function correctly are not available.
The default value is 
Methods
AsBinary(DbGeography) 
Gets the wellknown binary representation of the given DbGeography value. 
AsBinary(DbGeometry) 
Gets the wellknown binary representation of the given DbGeometry value. 
AsGml(DbGeography) 
Generates the Geography Markup Language (GML) representation of this DbGeography value. 
AsGml(DbGeometry) 
Generates the Geography Markup Language (GML) representation of this DbGeometry value. 
AsText(DbGeography) 
Gets the wellknown text representation of the given DbGeography value. This value should include only the Longitude and Latitude of points. 
AsText(DbGeometry) 
Gets the wellknown text representation of the given DbGeometry value, including only X and Y coordinates for points. 
AsTextIncludingElevationAndMeasure(DbGeography) 
Returns a text representation of DbSpatialServices with elevation and measure. 
AsTextIncludingElevationAndMeasure(DbGeometry) 
Returns a text representation of DbSpatialServices with elevation and measure. 
Buffer(DbGeography, Double) 
Creates a geography value representing all points less than or equal to distance from the given DbGeography value. 
Buffer(DbGeometry, Double) 
Creates a geometry value representing all points less than or equal to distance from the given DbGeometry value. 
Contains(DbGeometry, DbGeometry) 
Determines whether one DbGeometry value spatially contains the other. 
CreateGeography(DbSpatialServices, Object) 
This method is intended for use by derived implementations of GeographyFromProviderValue(Object) after suitable validation of the specified provider value to ensure it is suitable for use with the derived implementation. 
CreateGeometry(DbSpatialServices, Object) 
This method is intended for use by derived implementations of GeometryFromProviderValue(Object) after suitable validation of the specified provider value to ensure it is suitable for use with the derived implementation. 
CreateProviderValue(DbGeographyWellKnownValue) 
Creates a providerspecific value compatible with this spatial services implementation based on the specified wellknown DbGeography representation. 
CreateProviderValue(DbGeometryWellKnownValue) 
Creates a providerspecific value compatible with this spatial services implementation based on the specified wellknown DbGeometry representation. 
CreateWellKnownValue(DbGeography) 
Creates an instance of DbGeographyWellKnownValue that represents the specified DbGeography value using one or both of the standard wellknown spatial formats. 
CreateWellKnownValue(DbGeometry) 
Creates an instance of DbGeometryWellKnownValue that represents the specified DbGeometry value using one or both of the standard wellknown spatial formats. 
Crosses(DbGeometry, DbGeometry) 
Determines whether the two given DbGeometry values spatially cross. 
Difference(DbGeography, DbGeography) 
Computes the difference of two DbGeography values. 
Difference(DbGeometry, DbGeometry) 
Computes the difference between two DbGeometry values. 
Disjoint(DbGeography, DbGeography) 
Determines whether the two given DbGeography values are spatially disjoint. 
Disjoint(DbGeometry, DbGeometry) 
Determines whether the two given DbGeometry values are spatially disjoint. 
Distance(DbGeography, DbGeography) 
Computes the distance between the closest points in two DbGeography values. 
Distance(DbGeometry, DbGeometry) 
Computes the distance between the closest points in two DbGeometry values. 
ElementAt(DbGeography, Int32) 
Returns an element of the given DbGeography value, if it represents a geography collection. 
ElementAt(DbGeometry, Int32) 
Returns an element of the given DbGeometry value, if it represents a geometry collection. 
GeographyCollectionFromBinary(Byte[], Int32) 
Creates a new DbGeography collection value based on the specified wellknown binary value and coordinate system identifier (SRID). 
GeographyCollectionFromText(String, Int32) 
Creates a new DbGeography collection value based on the specified wellknown text value and coordinate system identifier (SRID). 
GeographyFromBinary(Byte[], Int32) 
Creates a new DbGeography value based on the specified wellknown binary value and coordinate system identifier (SRID). 
GeographyFromBinary(Byte[]) 
Creates a new DbGeography value based on the specified wellknown binary value. 
GeographyFromGml(String, Int32) 
Creates a new DbGeography value based on the specified Geography Markup Language (GML) value and coordinate system identifier (SRID). 
GeographyFromGml(String) 
Creates a new DbGeography value based on the specified Geography Markup Language (GML) value. 
GeographyFromProviderValue(Object) 
Creates a new DbGeography value based on a providerspecific value that is compatible with this spatial services implementation. 
GeographyFromText(String, Int32) 
Creates a new DbGeography value based on the specified wellknown text value and coordinate system identifier (SRID). 
GeographyFromText(String) 
Creates a new DbGeography value based on the specified wellknown text value. 
GeographyLineFromBinary(Byte[], Int32) 
Creates a new DbGeography line value based on the specified wellknown binary value and coordinate system identifier (SRID). 
GeographyLineFromText(String, Int32) 
Creates a new DbGeography line value based on the specified wellknown text value and coordinate system identifier (SRID). 
GeographyMultiLineFromBinary(Byte[], Int32) 
Creates a new DbGeography multiline value based on the specified wellknown binary value and coordinate system identifier. 
GeographyMultiLineFromText(String, Int32) 
Creates a new DbGeography multiline value based on the specified wellknown text value and coordinate system identifier. 
GeographyMultiPointFromBinary(Byte[], Int32) 
Creates a new DbGeography multipoint value based on the specified wellknown binary value and coordinate system identifier. 
GeographyMultiPointFromText(String, Int32) 
Creates a new DbGeography multipoint value based on the specified wellknown text value and coordinate system identifier. 
GeographyMultiPolygonFromBinary(Byte[], Int32) 
Creates a new DbGeography multi polygon value based on the specified wellknown binary value and coordinate system identifier. 
GeographyMultiPolygonFromText(String, Int32) 
Creates a new DbGeography multi polygon value based on the specified wellknown text value and coordinate system identifier. 
GeographyPointFromBinary(Byte[], Int32) 
Creates a new DbGeography point value based on the specified wellknown binary value and coordinate system identifier (SRID). 
GeographyPointFromText(String, Int32) 
Creates a new DbGeography point value based on the specified wellknown text value and coordinate system identifier (SRID). 
GeographyPolygonFromBinary(Byte[], Int32) 
Creates a new DbGeography polygon value based on the specified wellknown binary value and coordinate system identifier (SRID). 
GeographyPolygonFromText(String, Int32) 
Creates a new DbGeography polygon value based on the specified wellknown text value and coordinate system identifier (SRID). 
GeometryCollectionFromBinary(Byte[], Int32) 
Creates a new DbGeometry collection value based on the specified wellknown binary value and coordinate system identifier (SRID). 
GeometryCollectionFromText(String, Int32) 
Creates a new DbGeometry collection value based on the specified wellknown text value and coordinate system identifier (SRID). 
GeometryFromBinary(Byte[], Int32) 
Creates a new DbGeometry value based on the specified wellknown binary value and coordinate system identifier (SRID). 
GeometryFromBinary(Byte[]) 
Creates a new DbGeometry value based on the specified wellknown binary value. 
GeometryFromGml(String, Int32) 
Creates a new DbGeometry value based on the specified Geography Markup Language (GML) value and coordinate system identifier (SRID). 
GeometryFromGml(String) 
Creates a new DbGeometry value based on the specified Geography Markup Language (GML) value. 
GeometryFromProviderValue(Object) 
Creates a new DbGeometry value based on a providerspecific value that is compatible with this spatial services implementation. 
GeometryFromText(String, Int32) 
Creates a new DbGeometry value based on the specified wellknown text value and coordinate system identifier (SRID). 
GeometryFromText(String) 
Creates a new DbGeometry value based on the specified wellknown text value. 
GeometryLineFromBinary(Byte[], Int32) 
Creates a new DbGeometry line value based on the specified wellknown binary value and coordinate system identifier (SRID). 
GeometryLineFromText(String, Int32) 
Creates a new DbGeometry line value based on the specified wellknown text value and coordinate system identifier (SRID). 
GeometryMultiLineFromBinary(Byte[], Int32) 
Creates a new DbGeometry multiline value based on the specified wellknown binary value and coordinate system identifier. 
GeometryMultiLineFromText(String, Int32) 
Creates a new DbGeometry multiline value based on the specified wellknown text value and coordinate system identifier. 
GeometryMultiPointFromBinary(Byte[], Int32) 
Creates a new DbGeometry multipoint value based on the specified wellknown binary value and coordinate system identifier. 
GeometryMultiPointFromText(String, Int32) 
Creates a new DbGeometry multipoint value based on the specified wellknown text value and coordinate system identifier. 
GeometryMultiPolygonFromBinary(Byte[], Int32) 
Creates a new DbGeometry multi polygon value based on the specified wellknown binary value and coordinate system identifier. 
GeometryMultiPolygonFromText(String, Int32) 
Creates a new DbGeometry multi polygon value based on the specified wellknown text value and coordinate system identifier. 
GeometryPointFromBinary(Byte[], Int32) 
Creates a new DbGeometry point value based on the specified wellknown binary value and coordinate system identifier (SRID). 
GeometryPointFromText(String, Int32) 
Creates a new DbGeometry point value based on the specified wellknown text value and coordinate system identifier (SRID). 
GeometryPolygonFromBinary(Byte[], Int32) 
Creates a new DbGeometry polygon value based on the specified wellknown binary value and coordinate system identifier (SRID). 
GeometryPolygonFromText(String, Int32) 
Creates a new DbGeometry polygon value based on the specified wellknown text value and coordinate system identifier (SRID). 
GetArea(DbGeography) 
Returns a nullable double value that indicates the area of the given DbGeography value, which may be null if the value does not represent a surface. 
GetArea(DbGeometry) 
Returns a nullable double value that indicates the area of the given DbGeometry value, which may be null if the value does not represent a surface. 
GetBoundary(DbGeometry) 
Returns a nullable double value that indicates the boundary of the given DbGeography value. 
GetCentroid(DbGeometry) 
Returns a DbGeometry value that represents the centroid of the given DbGeometry value, which may be null if the value does not represent a surface. 
GetConvexHull(DbGeometry) 
Returns a nullable double value that indicates the convex hull of the given DbGeography value. 
GetCoordinateSystemId(DbGeography) 
Returns the coordinate system identifier of the given DbGeography value. 
GetCoordinateSystemId(DbGeometry) 
Returns the coordinate system identifier of the given DbGeometry value. 
GetDimension(DbGeography) 
Gets the dimension of the given DbGeography value or, if the value is a collections, the largest element dimension. 
GetDimension(DbGeometry) 
Gets the dimension of the given DbGeometry value or, if the value is a collections, the largest element dimension. 
GetElementCount(DbGeography) 
Returns the number of elements in the given DbGeography value, if it represents a geography collection. 
GetElementCount(DbGeometry) 
Returns the number of elements in the given DbGeometry value, if it represents a geometry collection. 
GetElevation(DbGeography) 
Returns the elevation (Z coordinate) of the given DbGeography value, if it represents a point. 
GetElevation(DbGeometry) 
Returns the elevation (Z) of the given DbGeometry value, if it represents a point. 
GetEndPoint(DbGeography) 
Returns a DbGeography value that represents the end point of the given DbGeography value, which may be null if the value does not represent a curve. 
GetEndPoint(DbGeometry) 
Returns a DbGeometry value that represents the end point of the given DbGeometry value, which may be null if the value does not represent a curve. 
GetEnvelope(DbGeometry) 
Gets the envelope (minimum bounding box) of the given DbGeometry value, as a geometry value. 
GetExteriorRing(DbGeometry) 
Returns a DbGeometry value that represents the exterior ring of the given DbGeometry value, which may be null if the value does not represent a polygon. 
GetInteriorRingCount(DbGeometry) 
Returns the number of interior rings in the given DbGeometry value, if it represents a polygon. 
GetIsClosed(DbGeography) 
Returns a nullable Boolean value that whether the given DbGeography value is closed, which may be null if the value does not represent a curve. 
GetIsClosed(DbGeometry) 
Returns a nullable Boolean value that whether the given DbGeometry value is closed, which may be null if the value does not represent a curve. 
GetIsEmpty(DbGeography) 
Returns a nullable Boolean value that whether the given DbGeography value is empty. 
GetIsEmpty(DbGeometry) 
Returns a nullable Boolean value that whether the given DbGeometry value is empty. 
GetIsRing(DbGeometry) 
Returns a nullable Boolean value that whether the given DbGeometry value is a ring, which may be null if the value does not represent a curve. 
GetIsSimple(DbGeometry) 
Returns a nullable Boolean value that whether the given DbGeometry value is simple. 
GetIsValid(DbGeometry) 
Returns a nullable Boolean value that whether the given DbGeometry value is valid. 
GetLatitude(DbGeography) 
Returns the Latitude coordinate of the given DbGeography value, if it represents a point. 
GetLength(DbGeography) 
Returns a nullable double value that indicates the length of the given DbGeography value, which may be null if the value does not represent a curve. 
GetLength(DbGeometry) 
Returns a nullable double value that indicates the length of the given DbGeometry value, which may be null if the value does not represent a curve. 
GetLongitude(DbGeography) 
Returns the Longitude coordinate of the given DbGeography value, if it represents a point. 
GetMeasure(DbGeography) 
Returns the M (Measure) coordinate of the given DbGeography value, if it represents a point. 
GetMeasure(DbGeometry) 
Returns the M (Measure) coordinate of the given DbGeometry value, if it represents a point. 
GetPointCount(DbGeography) 
Returns the number of points in the given DbGeography value, if it represents a linestring or linear ring. 
GetPointCount(DbGeometry) 
Returns the number of points in the given DbGeometry value, if it represents a linestring or linear ring. 
GetPointOnSurface(DbGeometry) 
Returns a DbGeometry value that represents a point on the surface of the given DbGeometry value, which may be null if the value does not represent a surface. 
GetSpatialTypeName(DbGeography) 
Returns a value that indicates the spatial type name of the given DbGeography value. 
GetSpatialTypeName(DbGeometry) 
Returns a value that indicates the spatial type name of the given DbGeometry value. 
GetStartPoint(DbGeography) 
Returns a DbGeography value that represents the start point of the given DbGeography value, which may be null if the value does not represent a curve. 
GetStartPoint(DbGeometry) 
Returns a DbGeometry value that represents the start point of the given DbGeometry value, which may be null if the value does not represent a curve. 
GetXCoordinate(DbGeometry) 
Returns the X coordinate of the given DbGeometry value, if it represents a point. 
GetYCoordinate(DbGeometry) 
Returns the Y coordinate of the given DbGeometry value, if it represents a point. 
InteriorRingAt(DbGeometry, Int32) 
Returns an interior ring from the given DbGeometry value, if it represents a polygon. 
Intersection(DbGeography, DbGeography) 
Computes the intersection of two DbGeography values. 
Intersection(DbGeometry, DbGeometry) 
Computes the intersection of two DbGeometry values. 
Intersects(DbGeography, DbGeography) 
Determines whether the two given DbGeography values spatially intersect. 
Intersects(DbGeometry, DbGeometry) 
Determines whether the two given DbGeometry values spatially intersect. 
Overlaps(DbGeometry, DbGeometry) 
Determines whether the two given DbGeometry values spatially overlap. 
PointAt(DbGeography, Int32) 
Returns a point element of the given DbGeography value, if it represents a linestring or linear ring. 
PointAt(DbGeometry, Int32) 
Returns a point element of the given DbGeometry value, if it represents a linestring or linear ring. 
Relate(DbGeometry, DbGeometry, String) 
Determines whether the two given DbGeometry values are spatially related according to the given Dimensionally Extended NineIntersection Model (DE9IM) intersection pattern. 
SpatialEquals(DbGeography, DbGeography) 
Determines whether the two given DbGeography values are spatially equal. 
SpatialEquals(DbGeometry, DbGeometry) 
Determines whether the two given DbGeometry values are spatially equal. 
SymmetricDifference(DbGeography, DbGeography) 
Computes the symmetric difference of two DbGeography values. 
SymmetricDifference(DbGeometry, DbGeometry) 
Computes the symmetric difference between two DbGeometry values. 
Touches(DbGeometry, DbGeometry) 
Determines whether the two given DbGeometry values spatially touch. 
Union(DbGeography, DbGeography) 
Computes the union of two DbGeography values. 
Union(DbGeometry, DbGeometry) 
Computes the union of two DbGeometry values. 
Within(DbGeometry, DbGeometry) 
Determines whether one DbGeometry value is spatially within the other. 
Applies to
Entity Framework