Showing posts with label GIS. Show all posts
Showing posts with label GIS. Show all posts

Friday, January 7, 2011

Importing GNIS into PostgreSQL - II

This is a continuation of my previous post. To make GNIS useable with spatial queries you need to add geometry or geography column to the table and create a spatial index.  Without the index traversing of a 2-million record table is very slow.  This is how to do it assuming that the data from GNIS tables has been imported as described in the previous post:

Thursday, December 2, 2010

Importing GNIS into PostgreSQL

The script below will load GNIS National File into PostgreSQL. You can download National File from here (about 280MB uncompressed, main web site). Place the uncompressed file in some directory and run the following script from psql:

The GNIS file has over two million records so it will take some time to load into PostgreSQL. I hope I guessed column types right.

P.S.: GNIS is the "Geographic Names Information System", a product from USGS.

Friday, February 12, 2010