Carlos Femmer's Blog

Carlos Femmer lives in Lafayette, LA and builds a few solutions for JCLS and Agency Virtual Tours

SQL Server 2008 Spatial Overview Part 1

March 24, 2008 19:15 by carlos

Here is part 1 of a multi part series describing the new spatial functionality in SQL Server 2008.  I am pretty pumped about Microsoft finally storing geometry in SQL Server.  Better late than never.  Anyway, I think this is a pretty exciting time to be working on Web / GIS applications.  There must be something unique about this space or Microsoft / Google / Yahoo /etc... would not be investing heavily in these areas.  Look at the popularity of Google Earth and more recently Virtual Earth.  Look at the explosion of mash ups where people are building applications from different sources and aggregating this information together.  Businesses need a mechanism to view their IP data in a graphical way.  There is still a need to use one of the big GIS companies (e.g. ESRI / Autodesk) but what about the small companies that don't need all the functionality and want to show a small amount of data.  I think this is where SQL Server 2008 and Virtual Earth come into play.  The nice thing is this is scalable and not limited to the small firms.  Big companies will find a cost benefit of displaying their data with SQL Server 2008 and Virtual Earth.  I am interested to see where Microsoft takes this technology over the next few years. 

SQL Server 2008 has two new data types so support spatial data (Geometry and Geography).  Geography is used to store geodetic data / ellipsoidal (Globe) and Geometry is used to support projected data / planar or Euclidean (Flat earth).  One thing to keep in mind if you are working with Virtual Earth in 2D.  Virtual Earth uses a Mercator projection to get from 3D to 2D.  The problem with this in Virtual Earth is your data is only good between 84 Degrees North and South.  I don't anticipate running into this problem (In VE) so I won't harp on it any longer.      

To get a better understanding of Geodesy, Projections and coordinate systems, click on the names of each.  

Geodetic Model

3DWorldGeodesy1

Projected Model

MercatorProjection1


Getting Started with SQL Server 2008

March 24, 2008 16:25 by carlos

Here is a quick and dirty tutorial to get your hands wet with the spatial features in SQL Server 2008.  There is an assumption that you have installed the SQL Server 2008 February 2008 CTP.

First - Download a sample database to play with.  You can download the sample database from here.

Second - Extract the two files somewhere on your hard drive.

Third - Attach the mdf to Sql Server 2008.

sql2008AttachDB  sql2008PickMDF  sql2008SpatialDB

Fourth - Right click on the feature (uscounties) and select "Select Top 1000 Rows".

sql2008ExecuteQuery

Fifth - Download the following tool from Morten's Blog to view the data (Download).  This is a very cool utility (Thanks Morten!)

There are 4 steps to follow.  Click on the image to increase the image size.

Sql2008SpatialQueryVisualizer

Cheers,

Carlos


Tags:
Categories: GIS | Sql Server 2008
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed