Presentation is loading. Please wait.

Presentation is loading. Please wait.

Spatial Database Tips & Tricks Paul Ramsey

Similar presentations


Presentation on theme: "Spatial Database Tips & Tricks Paul Ramsey"— Presentation transcript:

1 Spatial Database Tips & Tricks Paul Ramsey pramsey@opengeo.org

2 It’s not dead, it’s just resting…

3 Motivation Spatial databases are powerful Godlike, really You do not need “GIS software” Your database is “GIS software” You do not need “spatial middleware” See above

4 Standard Database Has data types –varchar –integer –real –date

5 Spatial Database Has spatial data types –point –linestring –polygon –multipoint –multilinestring –multipolygon

6 Standard Database Has one-dimensional indexes –b-tree –hash

7 Spatial Database Has spatial indexes –r-tree –quad-tree –grid

8

9

10

11

12 Find intersecting shapes…

13 Start with all boxes,

14 find intersecting boxes,

15 then find intersecting shapes.

16 Standard Database Has functions Work against standard types –lower()‏ –round()‏ –substring()‏ –trim()‏ –dayofweek ()‏

17 Spatial Database Has spatial functions Work against spatial types –ST_Area(geometry)‏ –ST_Distance(geometry,geometry)‏ –ST_Intersects(geometry,geometry)‏ –ST_DWithin(geometry,geometry,radius)‏ –ST_Union(geometry,geometry)‏

18

19 Open Geospatial Consortium (OGC)‏ Simple Features for SQL (SFSQL)‏

20

21 Locator Spatial

22 No buffer operation No union operation No intersection operation No centroid point No area or length calculation L O C A T O R

23 Linear referencing system (LRS) support Spatial analysis and mining functions and procedures (SDO_SAM package)‏ Geocoding support (SDO_GCDR package)‏ GeoRaster support Topology data model Network data model S P A T I A L

24 SFSQL compliant New release, not as many features No coordinate reference system transforms Windows only Grid index

25 SELECT * FROM the_table WHERE the_geom.STIntersects( geometry::STGeomFromText('POINT(0 0)',0)‏ ); SELECT * FROM the_table WHERE ST_Intersects( the_geom, ST_GeomFromText('POINT(0 0)',0)‏ );

26 PostgreSQL / PostGIS SFSQL compliant Open source (GPL)‏ Proprietary / open source clients “geographic” coordinates require care


Download ppt "Spatial Database Tips & Tricks Paul Ramsey"

Similar presentations


Ads by Google