# DbSpatialServices Class

**.NET Framework 4.6 and 4.5**

Represents a provider-independent service API for geospatial (Geometry/Geography) type support.

**Namespace:**System.Data.Spatial

**Assembly:**System.Data.Entity (in System.Data.Entity.dll)

Name | Description | |
---|---|---|

DbSpatialServices() | Initializes a new instance of the DbSpatialServices class. |

Name | Description | |
---|---|---|

Default | Gets the default services for the DbSpatialServices. |

Name | Description | |
---|---|---|

AsBinary(DbGeography) | Gets the well-known binary representation of the given DbGeography value. | |

AsBinary(DbGeometry) | Gets the well-known 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 well-known text representation of the given DbGeography value. This value should include only the Longitude and Latitude of points. | |

AsText(DbGeometry) | Gets the well-known 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 | |

Buffer(DbGeometry, Double) | Creates a geometry value representing all points less than or equal to | |

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 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 after suitable validation of the specified provider value to ensure it is suitable for use with the derived implementation. | |

CreateProviderValue(DbGeographyWellKnownValue) | Creates a provider-specific value compatible with this spatial services implementation based on the specified well-known DbGeography representation. | |

CreateProviderValue(DbGeometryWellKnownValue) | Creates a provider-specific value compatible with this spatial services implementation based on the specified well-known DbGeometry representation. | |

CreateWellKnownValue(DbGeography) | Creates an instance of DbGeographyWellKnownValue that represents the specified DbGeography value using one or both of the standard well-known spatial formats. | |

CreateWellKnownValue(DbGeometry) | Creates an instance of DbGeometryWellKnownValue that represents the specified DbGeometry value using one or both of the standard well-known 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. | |

Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) | |

Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) | |

GeographyCollectionFromBinary(Byte[], Int32) | Creates a new DbGeography collection value based on the specified well-known binary value and coordinate system identifier (SRID). | |

GeographyCollectionFromText(String, Int32) | Creates a new DbGeography collection value based on the specified well-known text value and coordinate system identifier (SRID). | |

GeographyFromBinary(Byte[]) | Creates a new DbGeography value based on the specified well-known binary value. | |

GeographyFromBinary(Byte[], Int32) | Creates a new DbGeography value based on the specified well-known binary value and coordinate system identifier (SRID). | |

GeographyFromGml(String) | Creates a new DbGeography value based on the specified Geography Markup Language (GML) value. | |

GeographyFromGml(String, Int32) | Creates a new DbGeography value based on the specified Geography Markup Language (GML) value and coordinate system identifier (SRID). | |

GeographyFromProviderValue(Object) | Creates a new DbGeography value based on a provider-specific value that is compatible with this spatial services implementation. | |

GeographyFromText(String) | Creates a new DbGeography value based on the specified well-known text value. | |

GeographyFromText(String, Int32) | Creates a new DbGeography value based on the specified well-known text value and coordinate system identifier (SRID). | |

GeographyLineFromBinary(Byte[], Int32) | Creates a new DbGeography line value based on the specified well-known binary value and coordinate system identifier (SRID). | |

GeographyLineFromText(String, Int32) | Creates a new DbGeography line value based on the specified well-known text value and coordinate system identifier (SRID). | |

GeographyMultiLineFromBinary(Byte[], Int32) | ||

GeographyMultiLineFromText(String, Int32) | ||

GeographyMultiPointFromBinary(Byte[], Int32) | ||

GeographyMultiPointFromText(String, Int32) | ||

GeographyMultiPolygonFromBinary(Byte[], Int32) | ||

GeographyMultiPolygonFromText(String, Int32) | ||

GeographyPointFromBinary(Byte[], Int32) | Creates a new DbGeography point value based on the specified well-known binary value and coordinate system identifier (SRID). | |

GeographyPointFromText(String, Int32) | Creates a new DbGeography point value based on the specified well-known text value and coordinate system identifier (SRID). | |

GeographyPolygonFromBinary(Byte[], Int32) | Creates a new DbGeography polygon value based on the specified well-known binary value and coordinate system identifier (SRID). | |

GeographyPolygonFromText(String, Int32) | Creates a new DbGeography polygon value based on the specified well-known text value and coordinate system identifier (SRID). | |

GeometryCollectionFromBinary(Byte[], Int32) | Creates a new DbGeometry collection value based on the specified well-known binary value and coordinate system identifier (SRID). | |

GeometryCollectionFromText(String, Int32) | Creates a new DbGeometry collection value based on the specified well-known text value and coordinate system identifier (SRID). | |

GeometryFromBinary(Byte[]) | Creates a new DbGeometry value based on the specified well-known binary value. | |

GeometryFromBinary(Byte[], Int32) | Creates a new DbGeometry value based on the specified well-known binary value and coordinate system identifier (SRID). | |

GeometryFromGml(String) | Creates a new DbGeometry value based on the specified Geography Markup Language (GML) value. | |

GeometryFromGml(String, Int32) | Creates a new DbGeometry value based on the specified Geography Markup Language (GML) value and coordinate system identifier (SRID). | |

GeometryFromProviderValue(Object) | Creates a new DbGeometry value based on a provider-specific value that is compatible with this spatial services implementation. | |

GeometryFromText(String) | Creates a new DbGeometry value based on the specified well-known text value. | |

GeometryFromText(String, Int32) | Creates a new DbGeometry value based on the specified well-known text value and coordinate system identifier (SRID). | |

GeometryLineFromBinary(Byte[], Int32) | Creates a new DbGeometry line value based on the specified well-known binary value and coordinate system identifier (SRID). | |

GeometryLineFromText(String, Int32) | Creates a new DbGeometry line value based on the specified well-known text value and coordinate system identifier (SRID). | |

GeometryMultiLineFromBinary(Byte[], Int32) | ||

GeometryMultiLineFromText(String, Int32) | ||

GeometryMultiPointFromBinary(Byte[], Int32) | ||

GeometryMultiPointFromText(String, Int32) | ||

GeometryMultiPolygonFromBinary(Byte[], Int32) | ||

GeometryMultiPolygonFromText(String, Int32) | ||

GeometryPointFromBinary(Byte[], Int32) | Creates a new DbGeometry point value based on the specified well-known binary value and coordinate system identifier (SRID). | |

GeometryPointFromText(String, Int32) | Creates a new DbGeometry point value based on the specified well-known text value and coordinate system identifier (SRID). | |

GeometryPolygonFromBinary(Byte[], Int32) | Creates a new DbGeometry polygon value based on the specified well-known binary value and coordinate system identifier (SRID). | |

GeometryPolygonFromText(String, Int32) | Creates a new DbGeometry polygon value based on the specified well-known 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. | |

GetHashCode() | Serves as the default hash function. (Inherited from Object.) | |

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 T:System.Data.Spatial. DbGeography value is empty. | |

GetIsEmpty(DbGeometry) | Returns a nullable Boolean value that whether the given T:System.Data.Spatial. 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 T:System.Data.Spatial. 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. | |

GetType() | ||

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. | |

MemberwiseClone() | ||

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 Nine-Intersection Model (DE-9IM) 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. | |

ToString() | Returns a string that represents the current object.(Inherited from Object.) | |

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. |

**.NET Framework**

Available since 4.5

Any public static (**Shared** in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.