Geography Reference
In-Depth Information
Let's look at one simple example to illustrate. Suppose someone says
“I live at latitude 18N, longitude 77W.” We want to know where that
is—what are our options?
We can start up our desktop GIS, load up a world country layer, and
move our mouse around to find the location. Or if we have the data in
PostGIS, we can quickly do a spatial query to determine the location:
desktop_data= # select cntry_name, pop_cntry from world_borders
where GeomFromText('POINT(-77 18)',4326) && the_geom;
cntry_name | pop_cntry
------------+-----------
Jamaica
|
2713130
(1 row)
The query uses the OGC function GeomFromText to create a tempo-
rary point object to use in the search. We use the && operator to test
whether the bounding boxes of the features (our point and all poly-
gons in the world) intersect. The query returns the results, in this case
Jamaica. This is a simple example of the power of queries using a spa-
tial database. The output isn't a map, and we didn't even use a GUI to
answer the question.
For details on using spatial functions and geometry constructors, see
the nicely detailed PostGIS manual. 8 Although you may think that
using these functions isn't a “desktop GIS” activity, it is an important
part of data preparation, conversion, and analysis, so it pays to check
out the features and capabilities.
7.4
Using PostGIS and Quantum GIS
QGIS and PostGIS have a long history—well, at least from the QGIS
side. The first working version of QGIS supported only one data type—
PostGIS. So, support for PostGIS has been included in QGIS from day
one. This means that the implementation is fairly complete and an
important part of the development and maintenance process.
8.
http://postgis.refractions.net/documentation
 
 
 
Search WWH ::




Custom Search