Download Spatial Database Tips & Tricks - Pennsylvania State University

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Spatial Database
Tips & Tricks
Paul Ramsey
pramsey@opengeo.org
It’s not dead, it’s just resting…
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
Standard Database
• Has data types
–
–
–
–
varchar
integer
real
date
Spatial Database
• Has spatial data types
–
–
–
–
–
–
point
linestring
polygon
multipoint
multilinestring
multipolygon
Standard Database
• Has one-dimensional indexes
– b-tree
– hash
Spatial Database
• Has spatial indexes
– r-tree
– quad-tree
– grid
Find intersecting shapes…
Start with all boxes,
find intersecting boxes,
then find intersecting shapes.
Standard Database
• Has functions
• Work against standard types
–
–
–
–
–
lower()
round()
substring()
trim()
dayofweek ()
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)
Spatial
Locator
LOCATOR
•
•
•
•
•
No buffer operation
No union operation
No intersection operation
No centroid point
No area or length calculation
SPATIAL
• 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
• SFSQL compliant
• New release, not as many features
• No coordinate reference system
transforms
• Windows only
• Grid index
SELECT * FROM the_table
WHERE ST_Intersects(
the_geom,
ST_GeomFromText('POINT(0 0)',0)
);
SELECT * FROM the_table
WHERE the_geom.STIntersects(
geometry::STGeomFromText('POINT(0 0)',0)
);
•
•
•
•
•
PostgreSQL / PostGIS
SFSQL compliant
Open source (GPL)
Proprietary / open source clients
“geographic” coordinates require care
Related documents