Geography Reference
In-Depth Information
Joe Asks. . .
What Is a Spatial Query?
A spatial query is one that involves features and their relation-
ship to one another. For example, assuming we had the appro-
priate data in our database, we might ask “Give me the names
of all the coffee shops within 10 kilometers of my house.” A spa-
tial database is well suited to that type of query and can eas-
ily answer that question. Another simple example is finding all
the eagle nests within a drainage basin. Of course, you can do
much more complex things with spatial queries including trans-
forming and creating new data, as well as projecting data on
the fly.
7.2
Open Source Spatial Databases
In the OSGIS world there are currently two options for spatially enabled
databases: PostgreSQL 1 with PostGIS 2 and MySQL. 3 Of the two, Post-
greSQL/PostGIS is the most mature and feature rich. MySQL has just
recently added basic support for geometries. Although the MySQL im-
plementation contains many of the OGC spatial functions, not all of
them are implemented according to the specification. If you just want
to store spatial features, MySQL may be the database for you. If you
want to use the database to do spatial processing and queries, Post-
greSQL with PostGIS is the best choice. Support for displaying features
stored in MySQL is just now emerging, so your options may be limited
in that regard as well.
There are other efforts in the spatial database realm, but none is to the
point that it can be used by the GIS enthusiast.
Comparison of Open Source Spatial Databases
Both PostGIS and MySQL implement the Open GIS Consortium's Open-
GIS Simple Features Specification for SQL (OGC). You can find the
specification on the OGC website at http://www.opengeospatial.org .
1.
http://postgresql.org
2.
http://postgis.refractions.net
3.
http://mysql.org
 
 
 
Search WWH ::




Custom Search