Skip to content
damien-hackadl edited this page Jun 1, 2013 · 4 revisions

Installing

$ sudo aptitude install postgresql-9.1-postgis
$ sudo psql -h localhost
onion=# create database onion
onion=# \q
$ sudo -u postgres createuser damien

Importing the Gazetteer

 shp2pgsql -W LATIN1 -c Gazetteer.shp | psql onion > /dev/null

There was a non-UTF-8 character, which needed the -W LATIN1.

A query

select name from gazetteer where the_geom && ST_MakeEnvelope(137.7, -34.2, 137.8, -34.5, -1);

-1 is the spatial reference system. We're not anal enough to care about one.

Clone this wiki locally