mysql spatial extensions - boston mysql meetup april 2005
DESCRIPTION
TRANSCRIPT
MySQL Meetup
MySQL Spatial ExtensionsAndrew CollinsApril 4th, 2005
Geometry
Curve
LineString
Line LinearRing
Polygon
Surface Geometry-Collection
MultiCurve
Multi-Polygon
Multi-Surface MultiPoint
Multi-LineString
1+
1+
1+
1+
2+
Point
OpenGIS Simple Features Specification for SQLGeometry Class Hierarchy
Non-InstantiableInstantiable
OpenGIS Simple Features Specification for SQLSpatial Data Model
MultiPoint
Geometry-Collection
Multi-LineString
Multi-Polygon
LinearRingPoint LineString
Polygon
SFS Methods : Basic● GeometryType()
– “POINT”, “POLYGON”, “LINEARRING” ...● Envelope()
– Polygon consisting of corner points of bounding box: ((MINX, MINY), (MAXX, MINY), (MAXX, MAXY), (MINX, MAXY), (MINX, MINY))
● AsText()– Returns string representation of the geometry in
Well-Known Text (WKT) format● ... and a few other basic methods
SFS Methods : Spatial Relations● Intersects(anotherGeometry : Geometry)
– Returns true if this Geometry 'spatially intersects' anotherGeometry.
● Touches(anotherGeometry : Geometry)– Returns true if this Geometry 'spatially touches'
anotherGeometry.● Contains(anotherGeometry : Geometry)
– Returns true if this Geometry 'spatially contains' anotherGeometry.
● ... and a few other spatial relational methods:– Equals(...), Disjoint(...), Crosses(...), Within(...),
Overlaps(...), and Relate(...)
SFS Methods : Spatial Analysis● Distance(anotherGeometry : Geometry)
– Return shortest distance between this Geometry and anotherGeometry.
● Union(anotherGeometry : Geometry)– Returns the point set union of this Geometry and
anotherGeometry.● Difference(anotherGeometry : Geometry)
– Returns the point set difference of this Geometry and anotherGeometry.
● ... and a few other spatial relational methods:– SymDifference(anotherGeometry : Geometry),
Buffer(distance : Double), ConvexHull( ), ...
“Not Yet Implemented”● The OpenGIS SFS specification is great, but...
– ... the spatial extensions are only available as of MySQL 4.1.x
– ... and the SFS specification is not fully implemented.
● Many of the spatial relations and analysis methods are “not yet implemented.”– This is understandable given the fact that “robust”
implementations of these methods are not easy to create.
JTS Topology Suite● The JTS Topology Suite
GML : Geography Markup Language
● Another OpenGIS specification used to format Simple Features in XML– XSLT available to translate GML to WKT– ... and MySQL INSERT commands
Links● Open Geospatial Consortium, Inc. (OGC)
http://www.opengeospatial.org/
● OGC: Simple Features - SQL (SFS)http://www.opengeospatial.org/docs/99-049.pdf
● Spatial Extensions in MySQL http://dev.mysql.com/doc/mysql/en/spatial-extensions-in-mysql.html
● Geography Markup Language (GML3.0)http://www.opengeospatial.org/specs/?page=specs
● JTS Topology Suitehttp://www.vividsolutions.com/jts/JTSHome.htm