Skip to content

[DATA] Helper to load spatial files with multiple formats into postgis

License

Notifications You must be signed in to change notification settings

mborne/node-ogr2pg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-ogr2pg

Node.js CI Coverage Status

Description

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

Usage

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

const result = await ogr2pg({
    'inputPath': 'place.shp',
    'tableName': 'place'
});

console.log(result.status);
console.log(result.message);
console.log(result.command);

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

About

[DATA] Helper to load spatial files with multiple formats into postgis

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published