What if we added New York City geographies to a PostGIS topology? Could we build a reverse geocoder?
Friends, this is our reverse goat, our rules, the trick is never to be afraid.
We will create a database named "nyctopo." We'll load the data under \data into a schema named "nyc."
Then we'll run a sibling set of topology data loading from \topo-data. This will create a topology named "gotham. For each dataset loaded we will add a column named "topo," populated with topogeom pointers to the gotham primitives.
$ export NYCTOPOPASSWORD==<samplepassword1>
$ export PGUSER=****
$ export PGPASSWORD=****
$ export PGHOST=****
$ export PGDATABASE=postgres
$ ./setup-nyctopo.sh
$ export PGUSER=nyctopo
$ export PGPASSWORD=<samplepassword1>
$ export PGHOST=****
$ export PGDATABASE=nyctopo
$ ./test-nyctopo.sh
We'll attempt to meet the requirements of applications by creating database views. More thinking required here on schemas, users, and privileges.
$ export MLPASSWORD=<samplepassword2>
$ export PGUSER=nyctopo
$ export PGPASSWORD=<samplepassword1>
$ export PGHOST=****
$ export PGDATABASE=nyctopo
$ ./setup-mobile_latlong.sh
$ export NYCTOPOPASSWORD==<samplepassword1>
$ export PGUSER=****
$ export PGPASSWORD=****
$ export PGHOST=****
$ export PGDATABASE=postgres
$ ./teardown-nyctopo.sh