Geo @ ObjectGraph

Earth and Environmental Science Blog

Hey there! Thanks for dropping by my blog! Take a look around
and grab the RSS feed to stay updated. See you around!

I finished installing ArcGIS Server 10 and I also installed a few spatial relational database. I would like to show some examples in Microsoft SQL Server 2008. In this article, I’m showing a difference between Geography Data Type and Geometry Data Type. To begin this discussion, I prepared one table in a database: Table Name = Locations

  • LocationID int
  • Name varcha
  • LocationGeom geometry
  • LocationGeog geography

According to this Wiki entry

  • GEOMETRY – This data type stores data in projected planar surfaces.
  • GEOGRAPHY – This data type stores data in an ellipsoidal model.

To calculate distance, I used STDistance function. Geography column returned the result in meter. On the other hand, the geometry returns the result in degree. I guess that’s the primary difference when you calculate distance or area.

Download SQL Script Examples from here . I’m also embedding it below:

 

You can leave a response, or trackback from your own site.

Leave a Reply