geography::STPointFromText
static constructor STPointFromText (called as type::STPointFromText(...))
What changes
- Input
- WKT, WKB, GML or coordinates and SRID
- Output or change
- spatial instance
- Return type
- SQL Server return type: geography CLR return type: SqlGeography OGC type: Point
Syntax at a glance
STPointFromText ( 'point_tagged_text' , SRID )
Work example
Use geography.STPointFromText to construct a point from WKT.
Check coordinate order and source SRID. Keep the geography type and SRID in the review.
Check your work WKT lists longitude first and latitude second; the returned coordinates are 47.651 and -122.349.
Practice SQL
Open in SQL FlowOpen the SQL for a walkthrough. Run the example in SQL Server to check its result.
SELECT geography::STPointFromText('POINT(-122.349 47.651)', 4326).Lat AS latitude, geography::STPointFromText('POINT(-122.349 47.651)', 4326).Long AS longitude;
Open Microsoft Learn for full syntax, permissions, and details for your version.