24. •
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 ) );
31. Spatial Aggregation
•
• SELECT Geography::UnionAggregate(geog) FROM Counties WHERE name = 'Washington';
• SELECT Geography::EnvelopeAggregate(geog) FROM Counties WHERE name = Washington';
•
32. • SELECT Geography::CollectionAggregate(geog) FROM Counties WHERE name = 'Washington';
• SELECT Geography::ConvexHullAggregate(geog) FROM Counties WHERE name = 'Washington';
34. 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 orientation
DECLARE @Globe GEOGRAPHY=GEOGRAPHY::STGeomFromText('FULLGLOBE',4326);
SELECT @Globe.STArea();-- calculate the area of the WGS84 ellipsoid
-- Result: 510,065,621,710,996 square meters