geography.ReorientObject
spatial method ReorientObject (instance.ReorientObject(...))
What changes
- Input
- spatial instance (and arguments)
- Output or change
- geography
- Return type
- SQL Server return type: geography CLR return type: SqlGeography
Syntax at a glance
.ReorientObject (geography)
Work example
Use geography.ReorientObject to reverse geography ring orientation when the intended interior is reversed.
Compare area and rendering with the original before keeping the change. Keep the geography type and SRID in the review.
Check your work The method reverses the polygon ring, switching which side is treated as its interior.
Practice SQL
Open in SQL FlowOpen the SQL for a walkthrough. Run the example in SQL Server to check its result.
SELECT p.shape.STArea() AS original_area_m2, p.shape.ReorientObject().STArea() AS reoriented_area_m2, p.shape.ReorientObject().STAsText() AS reoriented_wkt FROM (VALUES (geography::Parse('POLYGON((-10 -10, -10 10, 10 10, 10 -10, -10 -10))'))) AS p(shape);
Open Microsoft Learn for full syntax, permissions, and details for your version.