[postgis-users] Utility for creating geonames in PostGIS2
jack.varga at gmail.com
Tue Dec 11 12:38:22 PST 2012
Just sharing. If using geonames you may find this useful. Checks
timestamps, downloads most current, creates database (includes schema),
indexes, clusters, and assigns ownership. Documentation included.
Currently only grabs US postal codes but easily adaptable to grab any
country's postal codes. Makes a nice foundation for a simple location
based service. Works well with 2.x's indexed nearest neighbor searches
as described here:
For example, to find 10 closest hotels to downtown Boulder this query
SELECT name, fcode
FROM geonames WHERE fcode = 'HTL'
ORDER BY geom <-> st_setsrid(st_makepoint(-105.27997,40.01789),4326)
Code is here: http://jvarga.github.com/geonames-for-postgis/
More information about the postgis-users