Download presentation
Presentation is loading. Please wait.
Published byJunior West Modified over 9 years ago
1
Marko Tintor Danica Porobić Microsoft Development Center Serbia
2
Spatial in SQL Server 2008 What is spatial about? Applications Types, operations and indexing Computation on Earth surface Numerical operations Set operations Projections and visualization 3D visualization tool Extensible projection framework Q/A
4
Traditional GIS Now Consumer Developing LOB Ubiquity
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
6
We’re providing vector support We’re targeting geospatial... Spatial data which is referenced to a location on the Earth Typically uses spherical coordinates or projected planar coordinates I’ll come back to this distinction in a moment...but, there is no restriction that the data is actually geospatial Only 2D for now (Geodetic is 2D)
7
Vector Points LineStrings Polygons (Areas, Regions) Raster Satellite Imagery Digitized Aerial Photos
8
Which roads intersect Microsoft’s main campus? SELECT * FROM roads WHERE roads.geom.Intersects(@ms)=1
11
Flat maps are projections from the spheroid Small areas don’t distort too much Large areas do, so no good global projection Still very important for legislative and historical reasons conic secant projection
13
geography data type Geodetic (“Round Earth”) geospatial model 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 Define points, lines, and areas with coordinates Use for localized areas or non-projected surfaces such as interior spaces
14
Planar (flat-earth) Supports legacy and legal mapping requirements: surveyors and the specialist GIS crowd Computationally simpler Conceptually more difficult for geospatial Geodetic (round-earth) Supports existing long-range mapping requirements: military, shipping, etc. Computationally more complex Conceptually simpler for geospatial
15
Relationships Intersects Touches Disjoint Constructions Intersection, Union, Difference Numeric Computations Distance, Length Area Special Operations Point in polygon Buffer Reduce
16
New type: geometry Built on the same infrastructure Geometry can store instances of various types Points Line strings Polygons Collections of the above Methods for computing Spatial relationships: intersects, disjoint, etc. Spatial constructions: intersection, union, etc. Metric functions: distance, area
17
Second type: geography Very similar interface to geometry Some methods have different semantics Most data commonly available user data is geodetic Anything expressed as latitude/longitude This is the type we expect most people to be interested in
18
Web Server Client Virtual Earth Service SQL Server
23
Spatial indexing is built into the query engine Grid-based quad-tree index structure
24
42.3
25
Indexed Operations g1.STIntersects(geometry2) = 1 g1.STTouches(geometry2) = 1 g1.STEquals(geometry2) = 1 g1.STWithin(geometry2) = 1 g1.STContains(geometry2) = 1 g1.STDistance(geometry2) < number No native support for nearest neighbor
26
Requirements: Locally: edge should appear straight Pair of points should define unique edge Edge should have differentiable parameterization Possible solution: Geodesic curves (shortest path between points) Not suitable for points that are not on surface Two points define more than one edge Computations are extremely difficult
27
Space of directions: Geographic coordinates of a point on the globe are defined by the direction of a vector that is normal to the surface of the globe at that point Space of directions – nonzero normal vectors Definition: An edge is the image under the Inverse Gaussian Mapping (IGM) of the short great circle arc on the sphere of directions between the unit normal vectors at its endpoints An edge is the image under the IGM of a line segment in the space of directions
28
Surface of rotational ellipsoid: Let (u,v,w) be normal at the surface of (x,y,z), so under IGM: Mapping is:
29
Great-circle arc on the sphere of unit normal vectors Edge on ellipsoid Linear parameterization of great circle arc’s chord Parameterization
30
Velocity vector: Length of an edge: Area: sum of integrals over edges Computation using Gauss Legendre quadrature Long edges broken into pieces
31
Spherical arcs projected to lines using gnomonic projections Boolean operations on sphere transform to their planar counterparts after projection Planar operations rely on geometric library from Windows Vista Gnomonic projection works for smaller objects Larger objects handled by tiled projection
32
Central projection from the origin to a plane that is tangent to the unit sphere The image of a polygon on sphere is a polygon in the plane Let C be the point of tangency Basis vectors: two mutually orthogonal unit vectors A and B, orthogonal to C Projection of vector U: V = U/U∙C Planar coordinates: (V-C)∙A and (V-C)∙B
33
Map the scene with simple projections onto four facets of the tetrahedron Affine projection along the axis into the plane
34
Building blocks Points LineStrings Polygons Points and LineStrings are easy to display But, how to display the polygons?
35
Even polygons with small number of vertices can have unintuitive shape
36
curved (spherical) surface polygons can have holes polygons can be non-convex polygons can be near / span over poles polygons can cross ±180 degrees meridian
37
Vector Subdivide the polygon until all parts are simple enough Raster Render the polygon to the texture and wrap that texture around sphere
38
Subdivide entire Earth into patches Render only the patches that are on the inside of the polygon Use smaller patches near the border of polygon
39
Completely inside On the border Completely outside
40
FUNC RenderPatch(patch, polygon) IF patch is INSIDE the polygon Render(patch) IF patch is ON BORDER of the polygon AND patch is not too small FOREACH piece IN Subdivide(patch) RenderPatch(piece, polygon) IF patch is OUTSIDE polygon ignore it
41
Triangle Easy to render Easy to subdivide Easy to tile
42
Start from octahedron Subdivide each triangle recursively
46
Sql Server Spatial http://www.microsoft.com/sqlserver/2008/en/us/spatial- data.aspx Microsoft Development Center Serbia http://www.microsoft.com/scg/mdcs/default.mspx Defining Edges on a Round Earth Michael Kallay, Microsoft Corporation ACM GIS ’07, Seattle, November 2007
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.