Taking Microsoft SQL Server into the World of Spatial Data Management Michael Rys Principal Program Manager Microsoft DBI324
The Business Opportunity Increased user-sophistication More data sources More kinds of data Integrated systems and mash-ups Ubiquitous geographical technology GPS Online mapping services Availability of geographical data
demo Spatial Teaser
Customer-base management and development Environmental- related data impact, analysis, and planning Financial and economic analysis in communities Government-based planning and development analysis Market segmentation and analysis Scientific research study design and analysis Real-estate development and analysis
geography data type Geodetic (“Round Earth”) geospatial model: Ellipsoidal coordinates (Lat, Long, Z, M) Define points, lines, and areas with longitude and latitude Account for planetary curvature and obtain accurate “great circle” distances geometry data type Planar (“Flat Earth”) geospatial model projected ‘flat map’ (X, Y, Z, M) Define points, lines, and areas with coordinates Use for localized areas or non-projected surfaces such as interior spaces
The Mercator projection did not come out until Please play along
Well-Known-Binary: 0x CDDC C0D CDD CD D C07A CDD BD0F CDDC C0D41 Well-Known-Text: 'POLYGON(( , , , , ))' GML:
GEOMETRYCOLLECTION (POLYGON (( , , , )), LINESTRING ( , ), POLYGON (( , , , )), POLYGON (( , , , )), …..
demo Spatial Examples
CIRCULARSTRING (0 50, 90 50, , , 0 50) CURVEPOLYGON (CIRCULARSTRING (0 50, 90 50, , , 0 50)) If a circular linestring encloses an area, a curve polygon can be created Coordinate pair order is important for the geography type. This set of coordinates is ordered according to the “left foot rule” for exterior rings.
Both types provide static and instance methods Calculate distances, find intersections, etc. SELECT StreetName FROM Streets WHERE = 1 Find streets that intersect the Microsoft campus
BufferWithCurves() GEOGRAPHY = GEOGRAPHY::STGeomFromText('CIRCULARSTRING(0 50, 45 50, 90 50)',4326) GEOGRAPHY --Number of vertices: 11 GEOGRAPHY = GEOGRAPHY::STGeomFromText('CIRCULARSTRING(0 50, 45 50, 90 50)',4326) GEOGRAPHY --Number of vertices: 257 This method will construct the resulting polygon with circular arcs, often resulting in a dramatically smaller spatial object.
ReorientObject This method will reverse the order of coordinates which define polygon rings. This method is a NoOp on line strings, circular arcs and points. This method does only work with the GEOGRAPHY type.
demo Generating and Loading Spatial Data
demo Spatial Indexing
Take advantage of comprehensive spatial support geometry and geography data types Methods for spatial operations On premise and in the cloud Build high performance spatial solutions Store spatial data with business data Spatial indexing Extend and integrate geospatial applications Industry-standards compatibility Comprehensive programmatic library
Some Spatial Presentations (with further links) and whitepapers: data-queries-in-sql-server-2012.aspx Forum: Blogs: Find Me Later At… SQL Server Booth Wednesday 6/13 from 12:30 to
Michael Rys
Connect. Share. Discuss. Learning Microsoft Certification & Training Resources TechNet Resources for IT Professionals Resources for Developers
Required Slide Complete an evaluation on CommNet and enter to win!
Scan the Tag to evaluate this session now on myTechEd Mobile