Spatial
Spatial-
•                             •                         –                             •                         –         ...
•            –            –            –₪   –           •        -       •
•     -         DBA •MS SQL 2000-2012 –    Oracle 9i-11g – SQL Anywhere 10 –          Sybase –
-                                •                                 •       Reporting Services    –     Integration Service...
GIS                   •                           •Y     X                – Y             X       –           Y       X   ...
•–    •–    •–
DB-                 SQL-   •                        •                    –         x,y,z      –                    –      ...
Point           –                                                         •                                               ...
Polygon                                                   •                                                   •           ...
•                                                         –STGeomFromText        •SET @g = Geometry::STGeomFromText(LINEST...
latitude- longitude -   •                                •WGS84    GPS
•-   –    –
Spatial indexes                            •                        –                        –                        –O(n...
•    <>=          •-         •
•Fixed quadtree           •                 index                         •
•    –••    –•
B-trees-                              SQL-     •                    -                           •four-level grid -       S...
•      Level                    Grid configuration        Number of cells      Low                      4x4               ...
Tessellation                 •                 • touched cells   •
Tessellation Rules                                   •                tessellation rules                 The covering rule...
The cells-per-object rule •
The deepest-cell rule •
Spatial Aggregation                                                                                      ••   SELECT Geogr...
•   SELECT Geography::CollectionAggregate(geog) FROM Counties WHERE name = Washington;•   SELECT Geography::ConvexHullAggr...
SQL 2012 -                                                    Circular Arc-          •      – CircularString      – Compou...
Full Globe Support                                                            SQL 2008 •                                  ...
Spatial Index Enhancements                          -                 •                                  Auto-grid •      ...
•        •        •-       •        •    -   •
SQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: Spatial
Upcoming SlideShare
Loading in …5
×

SQL Explore 2012 - Aviad Deri: Spatial

894 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
894
On SlideShare
0
From Embeds
0
Number of Embeds
165
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

SQL Explore 2012 - Aviad Deri: Spatial

  1. 1. Spatial
  2. 2. Spatial-
  3. 3. • • – • – – • Tessellation • Spatial Aggregations •SQL 2012- •
  4. 4. • – – –₪ – • - •
  5. 5. • - DBA •MS SQL 2000-2012 – Oracle 9i-11g – SQL Anywhere 10 – Sybase –
  6. 6. - • • Reporting Services – Integration Services – Spatial – PowerShell – Mirroring, Replication – • • •
  7. 7. GIS • •Y X – Y X – Y X – – •
  8. 8. •– •– •–
  9. 9. DB- SQL- • • – x,y,z – – • –WGS84- – –
  10. 10. Point – • •M- z x,y • POINT(10 10) / POINT(10 10 10 1) • Linestring – LINESTRING(0 0, 10 10) • • • •
  11. 11. Polygon • • • Collection – • • GeomCollection •MultiPoints,MultiPolygon,MultiLineString •
  12. 12. • –STGeomFromText •SET @g = Geometry::STGeomFromText(LINESTRING(0 0, 10 10, 21 2),0) – STEnvelope • – STConvexHull • – STDifference() • – STIntersection() • – STUnion() •
  13. 13. latitude- longitude - • •WGS84 GPS
  14. 14. •- – –
  15. 15. Spatial indexes • – – –O(n)O(logn)
  16. 16. • <>= •- •
  17. 17. •Fixed quadtree • index •
  18. 18. • –•• –•
  19. 19. B-trees- SQL- • - •four-level grid - SQL- B- hierarchy •
  20. 20. • Level Grid configuration Number of cells Low 4x4 16 Medium 8x8 High 16x16 256 •• CREATE SPATIAL INDEX SIndx_SpatialTable_geography_col3 ON SpatialTable2(object) WITH ( GRIDS = ( LEVEL_3 = HIGH, LEVEL_2 = HIGH ) );
  21. 21. Tessellation • • touched cells •
  22. 22. Tessellation Rules • tessellation rules The covering rule • – – – –
  23. 23. The cells-per-object rule •
  24. 24. The deepest-cell rule •
  25. 25. Spatial Aggregation •• SELECT Geography::UnionAggregate(geog) FROM Counties WHERE name = Washington;• SELECT Geography::EnvelopeAggregate(geog) FROM Counties WHERE name = Washington;•
  26. 26. • SELECT Geography::CollectionAggregate(geog) FROM Counties WHERE name = Washington;• SELECT Geography::ConvexHullAggregate(geog) FROM Counties WHERE name = Washington;
  27. 27. SQL 2012 - Circular Arc- • – CircularString – CompoundCurve – CurvePolygon – –DECLARE@CircularSegmentGEOGRAPHY=GEOGRAPHY::STGeomFromText(CIRCULARSTRING(0 -30, 0 0, 0 30),4326);SELECT @CircularSegmentAS Shape;
  28. 28. Full Globe Support SQL 2008 • • – EnvelopeAngle() method returns 180 for objects larger than a logical hemisphere and < 90 for smaller objects – ReorientObject() reverses the ring orientationDECLARE @Globe GEOGRAPHY=GEOGRAPHY::STGeomFromText(FULLGLOBE,4326);SELECT @Globe.STArea();-- calculate the area of the WGS84 ellipsoid-- Result: 510,065,621,710,996 square meters
  29. 29. Spatial Index Enhancements - • Auto-grid • GRIDS – - – – • - – Hints •
  30. 30. • • •- • • - •

×