Download presentation
Presentation is loading. Please wait.
Published byProsper McDonald Modified over 9 years ago
1
Taking Microsoft SQL Server into the World of Spatial Data Management Milan Stojic, Michael Rys Program Managers Microsoft Corporation @Desinderlase, @SQLServerMike DBI324
3
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
4
demo Spatial Teaser
5
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
11
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
12
The Mercator projection did not come out until 1569. Please play along
13
Well-Known-Binary: 0x0103000000010000000500000000000000004CDDC00 0000000004C0D4100000000004CDD4000000000004CD D4000000000C07A104100000000004CDD40000000000 0BD0F41000000000088134100000000004CDDC000000 000004C0D41 Well-Known-Text: 'POLYGON(( -30000 240000, 30000 30000, 270000 30000, 260000 320000, -30000 240000))' GML: -30000 240000 30000 30000 270000 30000 260000 320000 -30000 240000
14
GEOMETRYCOLLECTION (POLYGON ((228869.875 314609.75, 228870.82875722542 314611.91763005778, 228852.73214285716 314634.03571428568, 228869.875 314609.75)), LINESTRING (218999.875 310799.75, 218890.89169195751 310666.54817905917), POLYGON ((214987.51136363635 305790.84090909094, 215609.875 305879.75, 215639.875 306329.75, 214987.51136363635 305790.84090909094)), POLYGON ((214949.875 305759.75, 214987.51136363635 305790.84090909094, 214922.60227272729 305781.56818181818, 214949.875 305759.75)), …..
15
demo Spatial Examples
16
CIRCULARSTRING (0 50, 90 50, 180 50, 270 50, 0 50) CURVEPOLYGON (CIRCULARSTRING (0 50, 90 50, 180 50, 270 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.
17
Both types provide static and instance methods Calculate distances, find intersections, etc. SELECT StreetName FROM Streets WHERE Streets.StreetGeo.STIntersects(@ms) = 1 Find streets that intersect the Microsoft campus
20
BufferWithCurves() DECLARE @g GEOGRAPHY = GEOGRAPHY::STGeomFromText('CIRCULARSTRING(0 50, 45 50, 90 50)',4326) DECLARE @b GEOGRAPHY = @g.BufferWithCurves(500000) SELECT @b.STNumPoints() --Number of vertices: 11 DECLARE @g GEOGRAPHY = GEOGRAPHY::STGeomFromText('CIRCULARSTRING(0 50, 45 50, 90 50)',4326) DECLARE @b GEOGRAPHY = @g.STBuffer(500000) SELECT @b.STNumPoints() --Number of vertices: 257 This method will construct the resulting polygon with circular arcs, often resulting in a dramatically smaller spatial object.
21
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.
22
demo More Spatial Examples
30
demo Generating and Loading Spatial Data
32
demo Spatial Indexing
36
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
37
Some Spatial Presentations (with further links) and whitepapers: http://www.slideshare.net/MichaelRys/sqlbits-x-sql-server-2012-spatial http://www.slideshare.net/MichaelRys/sqlbits-x-sql-server-2012-spatial-indexing http://social.technet.microsoft.com/wiki/contents/articles/9694.tuning-spatial-point- data-queries-in-sql-server-2012.aspx Forum: http://social.msdn.microsoft.com/Forums/en-US/sqlspatial/threads Blogs: http://blogs.msdn.com/b/edkatibah/ Find Us Later At… @Desinderlase, @SQLServerMike {milans, mrys}@microsoft.com Breakout Sessions DBI405 - Troubleshooting SQL Server Spatial Query Performance: A Deep Dive into Spatial Indexing
38
@sqlserver @teched_europe mva Microsoft Virtual Academy SQL Server 2012 Eval Copy Get Certified! Hands-On Labs
39
Connect. Share. Discuss. http://europe.msteched.com Learning Microsoft Certification & Training Resources www.microsoft.com/learning TechNet Resources for IT Professionals http://microsoft.com/technet Resources for Developers http://microsoft.com/msdn
40
Evaluations http://europe.msteched.com/sessions Submit your evals online
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.