# SqlGeometry Methods

**SQL Server 2008 R2**

The SqlGeometry type exposes the following members.

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

AsGml | Returns the Geography Markup Language (GML) representation of a SqlGeometry instance. | |

AsTextZM | Returns the Open Geospatial Consortium (OGC) Well-Known Text (WKT) representation of a SqlGeometry instance, augmented with any Z (elevation) and M (measure) values carried by the instance. | |

BufferWithTolerance | Returns a geometric object that represents the union of all point values whose distance from a SqlGeometry instance is less than or equal to a specified value, allowing for a specified tolerance. | |

Equals | (Inherited from Object.) | |

Filter | Offers a fast, index-only intersection method to determine if a SqlGeometry instance intersects another SqlGeometry instance, assuming an index is available. | |

Finalize | (Inherited from Object.) | |

GeomFromGml | Constructs a SqlGeometry instance given a representation in the SQL Server subset of the Geography Markup Language (GML). | |

GetHashCode | (Inherited from Object.) | |

GetType | (Inherited from Object.) | |

InstanceOf | Tests if the SqlGeometry instance is the same as the specified type. | |

MakeValid | Converts an invalid SqlGeometry instance into a SqlGeometry instance with a valid Open Geospatial Consortium (OGC) type. | |

MemberwiseClone | (Inherited from Object.) | |

Parse | Returns a SqlGeometry instance from an Open Geospatial Consortium (OGC) Well-Known Text (WKT) representation. | |

Point | Constructs a SqlGeometry instance that represents a Point instance from its X and Y values and an SRID. | |

Populate | Applies a geometry type call sequence to an IGeometrySink object. The call sequence is a sequential set of figures, lines, and points. SqlGeometry | |

Read | Reads a binary representation of a geometry type into a SqlGeometry object. SqlGeometry | |

Reduce | Returns an approximation of the given SqlGeometry instance produced by running the Douglas-Peucker algorithm on the instance with the given tolerance. | |

STArea | Returns the total surface area of a SqlGeometry instance. | |

STAsBinary | Returns the Open Geospatial Consortium (OGC) Well-Known Binary (WKB) representation of a SqlGeometry instance. This value will not contain any Z or M values carried by the instance. | |

STAsText | Returns the Open Geospatial Consortium (OGC) Well-Known Text (WKT) representation of a SqlGeometry instance. This text will not contain any Z (elevation) or M (measure) values carried by the instance. | |

STBoundary | Returns the boundary of a SqlGeometry instance. | |

STBuffer | Returns a geometric object that represents the union of all points whose distance from a SqlGeometry instance is less than or equal to a specified value. | |

STCentroid | Returns the geometric center of a SqlGeometry instance consisting of one or more polygons. | |

STContains | Specifies whether the calling SqlGeometry instance completely contains another SqlGeometry. | |

STConvexHull | Returns an object that represents the convex hull of a SqlGeometry instance. | |

STCrosses | Determines whether the calling SqlGeometry instance crosses the specified SqlGeometry instance. | |

STDifference | Returns an object that represents the points from one SqlGeometry instance that do not lie within another SqlGeometry instance. | |

STDimension | Returns the maximum dimension of a SqlGeometry instance. | |

STDisjoint | Determines whether the calling SqlGeometry instance is disjointed when compared against the specified SqlGeometry. | |

STDistance | Returns the shortest distance between a point in a SqlGeometry instance and a point in the specified SqlGeometry instance. | |

STEndPoint | Returns the end point of a SqlGeometry instance. | |

STEnvelope | Returns the minimum axis-aligned bounding rectangle of the instance. | |

STEquals | Determines whether the specified SqlGeometry has a point set identical to the calling SqlGeometry. | |

STExteriorRing | Returns the exterior ring of a SqlGeometry instance that is a polygon. | |

STGeomCollFromText | Returns a SqlGeometry instance from an Open Geospatial Consortium (OGC) Well-Known Text (WKT) representation augmented with any Z (elevation) and M (measure) values carried by the instance. | |

STGeomCollFromWKB | Returns a SqlGeometry collection instance from an Open Geospatial Consortium (OGC) Well-Known Binary (WKB) representation. | |

STGeometryN | Returns the specified SqlGeometry in a SqlGeometry collection. | |

STGeometryType | Returns the Open Geospatial Consortium (OGC) type name represented by a geometry instance. SqlGeometry | |

STGeomFromText | Returns a SqlGeometry instance from an Open Geospatial Consortium (OGC) Well-Known Text (WKT) representation augmented with any Z (elevation) and M (measure) values carried by the instance. | |

STGeomFromWKB | Returns a SqlGeometry instance from an Open Geospatial Consortium (OGC) Well-Known Binary (WKB) representation. | |

STInteriorRingN | Returns the specified interior ring of a Polygon SqlGeometry instance. | |

STIntersection | Returns an object that represents the points where a SqlGeometry instance intersects another SqlGeometry instance. | |

STIntersects | Determines whether the calling SqlGeometry instance intersects another SqlGeometry. | |

STIsClosed | Determines whether the start and end points of the calling SqlGeometry are the same. | |

STIsEmpty | Indicates whether the calling SqlGeometry instance is empty. | |

STIsRing | Determines whether the calling SqlGeometry instance is a ring. | |

STIsSimple | Determines whether the calling SqlGeometry instance is simple. | |

STIsValid | Determines whether the SqlGeometry instance is well-formed. | |

STLength | Returns the total length of the elements in a SqlGeometry instance. | |

STLineFromText | Returns a SqlGeometry instance from an Open Geospatial Consortium (OGC) Well-Known Text (WKT) representation augmented with any Z (elevation) and M (measure) values carried by the instance. | |

STLineFromWKB | Returns a SqlGeometry LineString instance from an Open Geospatial Consortium (OGC) Well-Known Binary (WKB) representation. | |

STMLineFromText | ||

STMLineFromWKB | Returns a SqlGeometry MultiLineString instance from an Open Geospatial Consortium (OGC) Well-Known Binary (WKB) representation. | |

STMPointFromText | ||

STMPointFromWKB | Returns a SqlGeometry Point instance from an Open Geospatial Consortium (OGC) Well-Known Binary (WKB) representation. | |

STMPolyFromText | Returns a SqlGeometry instance from an Open Geospatial Consortium (OGC) Well-Known Text (WKT) representation with any Z (elevation) and M (measure) values carried by the instance. | |

STMPolyFromWKB | Returns a SqlGeometry MultiPolygon instance from an Open Geospatial Consortium (OGC) Well-Known Binary (WKB) representation. | |

STNumGeometries | Returns the number of SqlGeometry that comprise a SqlGeometry instance. | |

STNumInteriorRing | Returns the number of interior rings of a Polygon SqlGeometry instance. | |

STNumPoints | Returns the sum of the number of points in each of the figures in a SqlGeometry instance. | |

STOverlaps | Determines whether the specified SqlGeometry overlaps the current SqlGeometry. | |

STPointFromText | ||

STPointFromWKB | Returns a SqlGeometry Point instance from an Open Geospatial Consortium (OGC) Well-Known Binary (WKB) representation. | |

STPointN | Returns a specified point in a SqlGeometry instance. | |

STPointOnSurface | Returns an arbitrary point located within the interior of a SqlGeometry instance. | |

STPolyFromText | ||

STPolyFromWKB | Returns a SqlGeometry Polygon instance from an Open Geospatial Consortium (OGC) Well-Known Binary (WKB) representation. | |

STRelate | Determines whether the calling SqlGeometry is related to the specified SqlGeometry. | |

STStartPoint | Returns the start point of a SqlGeometry instance. | |

STSymDifference | Returns an object that represents all points that are either in one SqlGeometry instance or another SqlGeometry instance, but not those points that lie in both instances. | |

STTouches | Determines whether the specified SqlGeometry touches the current SqlGeometry. | |

STUnion | Returns an object that represents the union of a SqlGeometry instance with another SqlGeometry instance. | |

STWithin | Determines whether the current SqlGeometry is completely within the specified SqlGeometry instance. | |

ToString | Returns the Open Geospatial Consortium (OGC) Well-Known Text (WKT) representation of a SqlGeometry instance augmented with any Z (elevation) and M (measure) values carried by the instance. (Overrides Object.ToString().) | |

Write | Writes a SqlGeometry instance to a binary stream. SqlGeometry |

## Community Additions

ADD
Show: