mysql spatial extensions - boston mysql meetup april 2005

10
MySQL Meetup MySQL Spatial Extensions Andrew Collins April 4th, 2005

Upload: andrew-collins

Post on 19-Jan-2015

743 views

Category:

Technology


4 download

DESCRIPTION

 

TRANSCRIPT

Page 1: MySQL Spatial Extensions - Boston MySQL Meetup April 2005

MySQL Meetup

MySQL Spatial ExtensionsAndrew CollinsApril 4th, 2005

Page 2: MySQL Spatial Extensions - Boston MySQL Meetup April 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

Page 3: MySQL Spatial Extensions - Boston MySQL Meetup April 2005

OpenGIS Simple Features Specification for SQLSpatial Data Model

MultiPoint

Geometry-Collection

Multi-LineString

Multi-Polygon

LinearRingPoint LineString

Polygon

Page 4: MySQL Spatial Extensions - Boston MySQL Meetup April 2005

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

Page 5: MySQL Spatial Extensions - Boston MySQL Meetup April 2005

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(...)

Page 6: MySQL Spatial Extensions - Boston MySQL Meetup April 2005

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( ), ...

Page 7: MySQL Spatial Extensions - Boston MySQL Meetup April 2005

“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.

Page 8: MySQL Spatial Extensions - Boston MySQL Meetup April 2005

JTS Topology Suite● The JTS Topology Suite

Page 9: MySQL Spatial Extensions - Boston MySQL Meetup April 2005

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

Page 10: MySQL Spatial Extensions - Boston MySQL Meetup April 2005

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