NHD Postgis Loader
Source Data
National Hydrography Dataset - USGS
Download
ftp://nhdftp.usgs.gov/DataSets/Staged/SubRegions/FileGDB/HighResolution
Install
$ npm install nhd-load
Testing
Download the test filegdb, unzip it, and place it in ./test/fixtures
directory
Test Filegdb
ftp://nhdftp.usgs.gov/DataSets/Staged/SubRegions/FileGDB/HighResolution/NHDH1401_931v220.zip
To run the tests
$ npm test
API
nhd.loadFilegdb
var nhd = ;var nhdFilegdb = __dirname + './filegdbs/NHDData.gdb' // Path to filegdb; var dbOptions = dbname: 'test' user: 'postgres' password: 'password' host: 'localhost' port: '5432'; nhd;
nhd.dropSchema
var nhd = ; var dbOptions = dbname: 'test' user: 'postgres' password: 'password' host: 'localhost' port: '5432'; nhd;
CLI
loadFilegdb
$ nhd-load loadFilegdb --dbname=nhdtest --port=5432 --host=localhost --user=postgres --password=password filegdbs/NHDData.gdb nhd-load help Usage: nhd-load loadFilegdb <src> <options> nhd-load dropSchema <options> Example:// Load NHD data $ nhd-load loadFilegdb --dbname=nhdtest --port=5432 --host=localhost --user=postgres --password=password filegdbs/NHDData.gdb // Drop the transformed data and tables from the pg database $ nhd-load dropSchema --dbname=nhdtest --port=5432 --host=localhost --user=postgres --password=password filegdbs/NHDData.gdb Options: --format=[destination database] Default: PostgreSQL --dbname=[string] --user=[string] --password=[string] --port=[number] Default: 5432 --timeout=[number] Default: 300000 ms
Contact
Andy B