Community of VE/MapPoint Users and Developers
This is a discussion on Virtual Earth & SQL Server 2008 - Part 2: Spatial Data Management in SQL Server 2008 (1/3) within the Virtual Earth Blogs forums, part of the Blogs category; Spatial Data Management in SQL Server 2008 Spatial Data Types Since the Community Technology Preview (CTP) 5 which was released ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Virtual Earth & SQL Server 2008 - Part 2: Spatial Data Management in SQL Server 2008 (1/3) Spatial Data Management in SQL Server 2008Spatial Data TypesSince the Community Technology Preview (CTP) 5 which was released in November 2007, SQL Server 2008 supports two spatial data types: geometry and geography. Both data types are implemented as .NET Common Language Runtime (CLR) data types. The geometry data type is compliant with the Simple Features for SQL Specification, Version 1.1.0 according to the Open Geospatial Consortium (OGC) and supports planar or Euclidean (flat-earth) data. It is best used if you describe positions in coordinate systems which have the same scale in X- and Y-direction, such as the OSGB36 coordinate system mentioned before. The geography data type, on the other side, stores ellipsoidal (round-earth) data, such as latitude and longitude coordinates; it is thus a natural fit for the requirements of Virtual Earth. The difference becomes immediately clear if we have a look at the map. In the example below we see the different effects of a calling the STBuffer-function on a geometry… SELECT Geometry.STAsText() …and a geography… SELECT Geography.STAsText()
...data type. The first thing you notice is, that we have to use the same units as used in the spatial reference system for the geometry data type, i.e. we have to enter the size of the buffer in decimal degrees. That is something that doesn’t make sense to most users. On the other side the geography data type takes the size of the buffer in meters. Since the scale for WGS84 coordinate systems is different in X- and Y-directions and furthermore even different depending on the latitude, you see a distortion when using ellipsoidal data such as WGS84 with the geometry data type: Coming back to the units of our data, we see that a result in degrees is most of the times not reasonable when it comes to measuring distances and areas. If we use the geometry data type to measure the area of a building like this: DECLARE @g geometry; We get an unusable result of 4.420787637913E-07 “square degrees”. However, if we use the geography data type: DECLARE @g geography; e get a perfectly reasonable result of 3418.3 square meters. The bottom line: It makes more sense, in most cases, to use the geography data type if you use Virtual Earth. Please note: not all spatial functions are supported for both geography and geometry data types. For further reference have a look at the documentation. Supported GeometriesSQL Server supports all geometries as defined in the OGC Simple Feature Specification: On the other side Virtual Earth only supports Points, Lines and Polygons. Thus we need to split all multi-geometries into their components. Fortunately SQL Server 2008 supports us here with the necessary spatial-functions, e.g. if we have a MULTIPOLYGON we can retrieve the individual POLYGONs which are part of it: SELECT GeomCol1.STAsText() FROM FeatureDemo WHERE ID=6; Here is the result of these sample queries: MULTIPOLYGON (((...)), (()))
Technorati Tags: Virtual Earth,SQL Server 2008 ![]() ![]() Click here to view the article. Last edited by Eric Frost; 03-03-2008 at 08:21 AM. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Virtual Earth & SQL Server 2008 - Part 2: Spatial Data Management in SQL Server 2008 (3/3) | Johannes Kebeck's Blog | Virtual Earth Blogs | 0 | 03-02-2008 01:40 PM |
| Virtual Earth & SQL Server 2008 - Part 2: Spatial Data Management in SQL Server 2008 (2/3) | Johannes Kebeck's Blog | Virtual Earth Blogs | 0 | 03-02-2008 01:40 PM |
| Virtual Earth & SQL Server 2008 - Part 1: Introduction (2/2) | Johannes Kebeck's Blog | Virtual Earth Blogs | 0 | 03-02-2008 07:30 AM |
| Virtual Earth & SQL Server 2008 - Part 1: Introduction (1/2) | Johannes Kebeck's Blog | Virtual Earth Blogs | 0 | 03-02-2008 07:30 AM |
| MapDotNet Server 6.5 Supports SQL Server 2008 and New Virtual Earth Features | VE For Government | Virtual Earth Blogs | 0 | 11-12-2007 05:42 PM |
Newcastle Flights
For details on Newcastle flights visit Holiday Hypermarket. We don't just book holidays, we provide useful information about airports too.
Turkey Holidays
Find and book Turkey Holidays with Travel Counsellors. Holiday destinations around the world including Turkey.
Portugal Holidays
Lisbon is perhaps Europe's most pleasant and affordable city. Check out the fantastic architecture, delicious seafood and non-stop night-life. Book Portugal Holidays with us.
Holidays in Cuba
Holidays in Cuba are an eclectic mix of golden beaches, rich, colourful scenery and a proud cultural heritage. Book a break in Cuba now!
Cheap Greece Holidays
For cheap Greece holidays make sure you know when to book and who to book with. Visit ulookubook.com to get help with doing both of those things. Why not time your visit with a Greek festival?
Holiday Comparison
We can help you with holiday comparison when you check out the options at Travel.co.uk
Holidays in Lanzarote
A quality luxury hotel awaits your patronage in the Canary Islands. Get information on holidays in Lanzarote at On The Beach.