geography: Extended Methods on Geography Instances
none (documentation, rules or examples)
What changes
- Input
- none
- Output or change
- none
Syntax at a glance
n/a (reference page)
Work example
Use geography methods for diagnostics, simplification, or interchange beyond common OGC methods.
Check method compatibility level and output dimensions before using it in shared query code.
Check your work The point reports latitude 47.651, longitude -122.349, Z 10.3, M 12, and SRID 4326.
Practice SQL
Open in SQL FlowOpen the SQL for a walkthrough. Run the example in SQL Server to check its result.
SELECT p.shape.Lat AS latitude, p.shape.Long AS longitude, p.shape.Z AS elevation_m, p.shape.M AS route_measure, p.shape.HasZ AS has_z, p.shape.HasM AS has_m, p.shape.STSrid AS srid, p.shape.AsTextZM() AS wkt_zm FROM (VALUES (geography::STGeomFromText('POINT(-122.34900 47.65100 10.3 12)', 4326))) AS p(shape);
Open Microsoft Learn for full syntax, permissions, and details for your version.