GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Utility for autocreating spatialy indexed geonames in PostGIS  XML
Forum Index -> General
Author Message
jackvarga


[Avatar]

Joined: 11/12/2012 19:53:39
Messages: 1
Offline

Sharing utility for automating creation of geonames in PostGIS, This utility checks timestamps/filesize, grabbing most current data (when its run), creates geometry with GiST indexes, clusters and assigns user defined owner of database. It was designed for use with PostGIS >=2.x (implying Postgres >= 9.x)

Currently only grabs US postal codes but easily adapted to other country postal codes.

Used in conjunction with PostGIS 2's indexed nearest neighbor query, makes a nice location based service foundation. For example, to find the ten closest hotels to downtown Boulder, one might execute this query...

SELECT name, fcode
FROM geonames WHERE fcode = 'HTL'
ORDER BY geom <-> st_setsrid(st_makepoint(-105.27997,40.01789),4326)
LIMIT 10;

Code is here... http://jvarga.github.com/geonames-for-postgis/
[WWW]
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team