You think this an odd title, a square is a square. Well whilst that is the case in a planar 2D world in a 3 spatial world where the square is drawn on a sphere.

This is one of the areas that catches most people out.

If you define a polygon  with corners at (0,0) (0,50) (90,50) (90, 0). So this starts on the equator at Greenwich and then moves north until the 50 longitude, then moves to a point a quarter round the world again on longitude 50 and back to the equator on latitude 90.

On first glance you would think that the line from (0,50) to (90,50) follows ring that defines longitude 50, and this is the error. The line between these two points is actually the shortest distance between, which is part of  great circle. Morten has done a great blogpost on this Straight lines on a sphere .

What is a shame is that both Mortens Shape to Shapefile to SqlServer 2008 to WPF and Virtual earth both draw the polygon as though it followed the ring of longitude. What this leads to is confusion over when shapes intersect

This forum post illustrates the issue perfectly along with some images from Steven Hemingray that displays the issue Geography .STIntersects() incorrect if polygon is big

If you are likely to be working with Spatial data covering the earth I suggest you buy a globe to enable you to visualise the world.


This is cross posted from my SQLBlogcasts blog which can be found here, http://sqlblogcasts.com/blogs/simons/SQL Server 2008 Spatial - What shape is a square?

Categories:

Comments

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading



Theme design by Nukeation based on Jelle Druyts