dynamosm-importer
Stream some sql queries to a postgres database. Plus some tools for converting geojsons into sql on their way into the database
cli
On Max OS X, requires greadlink
, which you can install by running
brew install coreutils
dynamosm-importer
Given a url pointing at an osm.pbf, download the file, convert to geojson using minjur, and import to postgres.
export PGDB=my_database
dynamosm-importer "insert into my_table values ({geojson}) http://url/to/some.osm.pbf
dynamosm-importStream
export PGDB=my_database
cat line-delimited-geojsons.file | dynamosm-importStream "insert into my_table values ({geojson})"
js
querify
A transform stream that
- turns geojson strings in sql json literals
- will format a query for you, replacing {geojson}
- escapes any pesky single quotes that would otherwise ruin your sqlized json
DynamosmImporter
A writable stream that accepts sql queries, writing them to a postgres database in transactions/batches.
example
var split = ;var querify = querify;var ; var options = batchSize: 200 dbname: my_database dbuser: my_user fs ;