Sql Server Geography shape that is accidently covering the entire planet!
Given a valid polygon, but the shape covers the entire planet?
The points are fine, it's just the ring-orientation is (somehow) wrong. So we need to flip it.
SELECT a.Polygon.ReorientObject()
FROM SomeTable
WHERE Id = @SomeId
That's it!
NOTE: This only works with Sql Server 2012 (and greater).
(Image and code tip sourced from Alistair Aitchison's blog)
Written by Pure Krome
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Sql-server
Authors
purekrome
26.66K
lyndsysimon
1.147K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#