SQL Server 2008 Spatial Data - Getting Started

2,419 views

Published on

Overview of SQL 2008 spatial data types, spatial data operations, geocoding, and visualization. This does not include the visualization options added to SQL 2008 R2.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,419
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
28
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

SQL Server 2008 Spatial Data - Getting Started

  1. 1. SQL Server 2008 Spatial Data<br />Dan Crawford<br />Integrated Network Strategies<br />dcrawford@insindy.com<br />http://www.insindy.com<br />
  2. 2. What is spatial data?<br />Geometric<br />Represents data in a 2D plain, similar to graph paper in high school. Units are user-defined and could be inches, miles, pixels, etc.<br />
  3. 3. What is spatial data?<br />Geographic<br />Represents data points using angles of Latitude and Longitude. Latitude measures North/South, and Longitude measures degrees East/West of Prime Meridian<br />
  4. 4. System Requirements<br />SQL Server 2008 Express or higher<br />Dev Tools<br />Visual Studio 2005, 2008, or 2010<br />SQL Management Studio 2008<br />Not currently supported on SQL Azure, but will be soon<br />
  5. 5. Uses of spatial data<br />Used by central cancer registries for statistical analysis with other geography specific data sources, such as census data<br />Integrated route mapping with MapPoint, Google Maps, etc<br />Geographical business intelligence analytics<br />
  6. 6. Geometry data type<br />Geometry data type stores points, lines, polygons, and collections of geometric objects<br />Represent using WKT (well-known text), WKB (well-known binary), or GML (geography markup language)<br />WKT seems to be most common<br />
  7. 7. WKT Markup<br />POINT(x y)<br />LINESTRING(x1 y1,x2 y2)<br />POLYGON((x1 y1,x2 y2,x3 y3,x4 y4,x1 y1))<br />GEOMETRYCOLLECTION(Geo1, Geo2, …)<br />
  8. 8. Spatial Expressions<br />
  9. 9. More Spatial Expressions<br />
  10. 10. Geocoding<br />Geography data type does not directly understanding mailing address data<br />Mailing addresses must be converted to latitude/longitude coordinates<br />Geocoding = conversion of geographic data like address or zip code to geographic coordinates<br />Options – MapPoint/Bing Map Services, Google Maps API, many others<br />
  11. 11. Geocoding Example<br />
  12. 12. Rendering Options<br />SQL Management Studio 2008 – very basic for query testing<br />VirtualEarth<br />Google Maps or similar<br />Dundas mapping component<br />
  13. 13. Spatial Indexing<br />Images from Microsoft Technet<br />
  14. 14. Spatial Indexing<br />CREATE SPATIAL INDEX SPATIAL_Hospitals ON dbo.Hospitals(LocationGeography) <br />USING GEOGRAPHY_GRID<br /> WITH( GRIDS = ( LEVEL_1 = MEDIUM, <br /> LEVEL_2 = MEDIUM, <br /> LEVEL_3 = MEDIUM, <br /> LEVEL_4 = MEDIUM), <br />CELLS_PER_OBJECT = 16, STATISTICS_NORECOMPUTE = OFF, <br />ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)<br />
  15. 15. SQL Server 2008 R2<br />Adds native mapping support to SSRS<br />

×