Examining Spatial Properties

This chapter examines the methods and properties available to query individual items of geometry or geography data.

The following tables list the methods covered in this chapter. For each method, the book gives the syntax required to use that method, the results obtained, and an example code listing demonstrating a practical situation in which that method can be used. This chapter contains numerous diagrams to illustrate the results obtained from the methods available.

Properties that return individual coordinate values
Property Description Supported Datatypes
STX Returns the x coordinate of a point geometry
STY Returns the y coordinate of a point geometry
Lat Returns the latitude coordinate of a point geography
Long Returns the longitude coordinate of a point geography
M Returns the m coordinate of a point geometry geography
Z Returns the z coordinate of a point geometry geography
Methods that return individual points from a geometry
Method Description Supported Datatypes
STPointN() Returns the nth point of a geometry geometry geography
STStartPoint() Returns the first point of a geometry geometry geography
STEndPoint() Returns the last point of a geometry geometry geography
STCentroid() Returns the geometric center point of a Polygon instance geometry
EnvelopeCenter() Returns the envelope centre point of a geography instance geography
STPointOnSurface() Returns an abitrary point that lies within a geometry geometry
Describing a Geometry
Method Description Supported Datatypes
STGeometryType() Returns the name of the type of geometry. (e.g., Point, LineString) geometry geography
InstanceOf() Tests whether an instance is of a particular geometry type geometry geography
STDimension() Returns the number of dimensions that an instance occupies geometry geography
STIsSimple() Determines whether an instance is simple geometry
STIsClosed() Determines whether an instance is closed geometry
STIsRing() Determines whether an instance is a ring geometry
STNumPoints() Counts the number of points in a geometry geometry geography
STIsEmpty() Determines whether an instance is empty geometry
STSrid Sets or retrieves the SRID of the spatial reference system in which an instance is defined geometry geography
Metrics
Method Description Supported Datatypes
STLength() Returns the length of a geometry geometry geography
STArea() Tests whether an instance is of a particular geometry type geometry geography
Polygon Rings
Method Description Supported Datatypes
STExteriorRing() Returns the exterior ring of a Polygon instance geometry
STNumInteriorRing() Returns the number of interior rings in a Polygon instance geometry
STInteriorRingN() Returns the nth interior ring of a Polygon instance geometry
NumRings() Returns the total number of rings in a Polygon instance geography
RingN() Returns the nth ring of a Polygon instance/td> geography
Describing the extent of a geometry
Method Description Supported Datatypes
STBoundary() Returns the boundary of an instance geometry
STEnvelope() Returns the envelope (bounding box) of an instance geometry
EnvelopeAngle() Returns the angle between the centre of a geography instance and the most outlying point geography
Working with multielement geometries
Method Description Supported Datatypes
STNumGeometries() Returns the number of geometries in an instance geometry geography
STGeometryN() Returns a specific geometry from a multielement geometry geometry geography

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options