This topic is applicable to Entity Framework v5 and v6. For Entity Framework Core, see Spatial Data Support for EF Core.
The following table demonstrates which properties and methods of DbGeometry and DbGeography are supported by available spatial services:
Method/Property | Spatial service | |||||||
---|---|---|---|---|---|---|---|---|
Name | DbGeometry | DbGeography | NetTopologySuite1 | SharpMap1 | WKT | EWKT | WKB | OracleObject |
Instance Properties | ||||||||
Area | √ | √ | ||||||
Boundary | √ | – | ||||||
Centroid | √ | – | ||||||
ConvexHull | √ | – | ||||||
CoordinateSystemId | √ | √ | 2 | 2 | ||||
Dimension | √ | √ | ||||||
ElementCount | √ | √ | ||||||
Elevation | √ | √ | ||||||
EndPoint | √ | √ | ||||||
Envelope | √ | – | ||||||
ExteriorRing | √ | – | ||||||
InteriorRingCount | √ | – | ||||||
IsClosed | √ | √ | ||||||
IsEmpty | √ | √ | ||||||
IsRing | √ | – | ||||||
IsSimple | √ | – | ||||||
IsValid | √ | – | ||||||
Latitude | – | √ | ||||||
Length | √ | √ | ||||||
Longitude | – | √ | ||||||
Measure | √ | √ | ||||||
PointCount | √ | √ | ||||||
PointOnSurface | √ | – | ||||||
ProviderValue | √ | √ | ||||||
SpatialTypeName | √ | √ | 3 | |||||
StartPoint | √ | √ | ||||||
WellKnownValue | √ | √ | ||||||
XCoordinate | √ | – | ||||||
YCoordinate | √ | – | ||||||
Instance Methods | ||||||||
AsBinary | √ | √ | ||||||
AsGml | √ | √ | ||||||
StartPoint | √ | √ | ||||||
AsText | √ | √ | ||||||
Buffer | √ | √ | ||||||
Contains | √ | – | ||||||
Crosses | √ | – | ||||||
Difference | √ | √ | ||||||
Disjoint | √ | √ | ||||||
Distance | √ | √ | ||||||
ElementAt | √ | √ | ||||||
InteriorRingAt | √ | – | ||||||
Intersection | √ | √ | ||||||
Intersects | √ | √ | ||||||
Overlaps | √ | – | ||||||
PointAt | √ | √ | ||||||
Relate | √ | – | ||||||
SpatialEquals | √ | √ | ||||||
SymmetricDifference | √ | √ | ||||||
Touches | √ | – | ||||||
Union | √ | √ | ||||||
Within | √ | – | ||||||
Static Methods | ||||||||
FromBinary(Byte[]) | √ | √ | ||||||
FromBinary(Byte[], Int32) | √ | √ | ||||||
FromGml(String) | √ | √ | ||||||
FromGml(String, Int32) | √ | √ | ||||||
FromText(String) | √ | √ | ||||||
FromText(String, Int32) | √ | √ | ||||||
GeometryCollectionFromBinary | √ | √ | ||||||
GeometryCollectionFromText | √ | √ | ||||||
LineFromBinary | √ | √ | ||||||
LineFromText | √ | √ | ||||||
MultiLineFromBinary | √ | √ | ||||||
MultiLineFromText | √ | √ | ||||||
MultiPointFromBinary | √ | √ | ||||||
MultiPointFromText | √ | √ | ||||||
MultiPolygonFromBinary | √ | √ | ||||||
MultiPolygonFromText | √ | √ | ||||||
PointFromBinary | √ | √ | ||||||
PointFromText | √ | √ | ||||||
PolygonFromBinary | √ | √ | ||||||
PolygonFromText | √ | √ |
1 The mark in the SharpMap or NetTopologySuite column does not mean the feature is completely supported. It means that SharpMap or NetTopologySuite declares support for it, and it is used by our SharpMap or NetTopologySuite spatial service. However, this feature may not be implemented for some types and cases in the corresponding SharpMap or NetTopologySuite library.
2 WKT and WKB spatial services always return config.SpatialOptions.GeometryDefaultSrid for DbGeometry and config.SpatialOptions.GeographyDefaultSrid for DbGeography as CoordinateSystemId.
3 The returned SpatialTypeName value depends on config.SpatialOptions.SpatialTypeNameRepresentation value for OracleObject spatial service.