From 9f1960e51787284752c6eb5074396e875781a237 Mon Sep 17 00:00:00 2001 From: Simon Norris Date: Mon, 6 Mar 2017 19:13:35 -0800 Subject: [PATCH] add dimension option to ogr2pg --- pgdb/database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pgdb/database.py b/pgdb/database.py index 65a9e4b..fdebb5c 100644 --- a/pgdb/database.py +++ b/pgdb/database.py @@ -235,7 +235,7 @@ def create_table(self, table, columns): return Table(self, schema, table, columns) def ogr2pg(self, in_file, in_layer=None, out_layer=None, - schema='public', t_srs='EPSG:3005', sql=None): + schema='public', t_srs='EPSG:3005', sql=None, dim=2): """ Load a layer to provided pgdb database connection using OGR2OGR @@ -261,7 +261,7 @@ def ogr2pg(self, in_file, in_layer=None, out_layer=None, '-overwrite', '-lco SCHEMA={schema}'.format(schema=schema), '-lco GEOMETRY_NAME=geom', - '-dim 2', + '-dim {d}'.format(d=dim), '-nln '+out_layer, '-nlt PROMOTE_TO_MULTI', in_file,