0.2.1 • Published 5 years ago

@mborne/ogr2pg v0.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

node-ogr2pg

Description

Provides an helper to invoke ogr2ogr and psql to import spatial file into PostGIS.

Usage

const ogr2pg = require('@mborne/ogr2pg');

ogr2pg({
    'inputPath': 'place.shp',
    'tableName': 'place'
}).then(function(){
    console.log("Table public.place created from 'place.shp'");
}).catch(function(err){
    console.log(err.message);
});

Options

NameRequired?DescriptionDefault
inputPathYESInput file path (.shp, .geojson, etc.)
encodingNOInput encoding (UTF-8, LATIN1,...)UTF-8
tableNameYESOutput table name
createTableNOAutomatically create table (drop table if exists)false
schemaNameNOOutput schema namepublic
createSchemaNOAutomatically create schema if not existsfalse
promoteToMultiNOPromote geometry to multi (ex : MultiPolygon instead of Polygon)false
skipFailuresNOskip failures when importing datafalse

License

MIT

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

6 years ago