This is a collection of bash scripts used to extract USGS Historical Topo maps and insert them into PostGIS as rasters.
The USGS Historical Topo Maps can be downloaded from:
The USGS has a great document (pdf) explaining how to use GDAL to work with the USGS Topo Maps. This document helped me get a start on this project.
- Install GDAL/ogr tools, I created a script to do this
- Install PostgreSQL 9.4 with PostGIS 2.1 (other versions may work, but that's what I'm running).
You can probably do this with the command:
sudo apt-get install postgresql-9.4-postgis-2.1
- Create your database for all your rasters:
sudo -u postgres psql -c "CREATE DATABASE topo;"
- Geospatially enabled this database:
sudo -u postgres psql -d topo -c "CREATE EXTENSION postgis;"
- You need to enable the gdal drivers, which was a little hard to figure out, but there's a discussion on how to do it here.
- Now you're ready to start adding some topos! If you haven't already, clone this repository.
- Download a USGS topo map (you can use this one of Lambertville, NJ if you'd like)
- Run the import_zip.sh script on the zip file. Example:
bash ./import_zip.sh ./NJ_Lambertville_255237_1890_62500_geo.zip
- The raster should now be in your database! Getting the data out can be tricky, but there's a guide on it.
Enjoy!