npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

@mborne/ogr2pg

0.2.0 • Public • Published

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

Name Required? Description Default
inputPath YES Input file path (.shp, .geojson, etc.)
encoding NO Input encoding (UTF-8, LATIN1,...) UTF-8
tableName YES Output table name
createTable NO Automatically create table (drop table if exists) false
schemaName NO Output schema name public
createSchema NO Automatically create schema if not exists false
promoteToMulti NO Promote geometry to multi (ex : MultiPolygon instead of Polygon) false
skipFailures NO skip failures when importing data false

License

MIT

install

npm i @mborne/ogr2pg

Downloadsweekly downloads

1

version

0.2.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability