Bing Maps API - SQL - geometry vs geography type

admin

Administrator
Staff member
I'm developing a Mapping Service with Bing Maps AJAX API and SQL Server 2008. The question which appears to me is should I use the geography or geometry data type. I researched a lot but doesn't found a satisfactory answer. Here are some links about the topic:
<ul>
<li><a href="https://stackoverflow.com/questions/1867905/sql-2008-geography-geometry-which-to-use">SQL 2008 geography &amp; geometry - which to use?</a></li>
<li><a href="http://www.mssqltips.com/tip.asp?tip=1847" rel="nofollow noreferrer">http://www.mssqltips.com/tip.asp?tip=1847</a></li>
<li><a href="https://alastaira.wordpress.com/2011/01/23/the-google-maps-bing-maps-spherical-mercator-projection/" rel="nofollow noreferrer">https://alastaira.wordpress.com/2011/01/23/the-google-maps-bing-maps-spherical-mercator-projection/</a></li>
</ul>
If I compare the two types I see the following points.
<h3>pro geography</h3>
<ul>
<li>consistent distance calculation around the world (time line!)</li>
<li>the coordinate system of the database is the same as the one which is used to add data to a map with the Bing Maps API (WGS84)</li>
<li>precise</li>
</ul>
<h3>contra geography</h3>
<ul>
<li>high computational costs</li>
<li>data size constrained to one hemisphere</li>
<li>missing functions (STConvexHull(), STRelate(),...)</li>
</ul>
<h3>pro geometry</h3>
<ul>
<li>faster computation</li>
<li>unconstrained data size</li>
</ul>
<h3>contra geography</h3>
<ul>
<li>distance units in degree (if we use WGS84 coordinates)</li>
</ul>
The problem for me is that I don't need a fast framework, a great coverage (the whole world) and high functionality. So I would prefer the geometry type.
The problem with the geometry type is, that I have to transform my data into a flat projection (Bing Map use SRID=3875), so that I get meters for the calculation. But when I use the Bing Maps projection (3875) in the database I have to transform my data back to WGS84 if I won't to display it in the map.