Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
fix #12,#4
Browse files Browse the repository at this point in the history
  • Loading branch information
smnorris committed Mar 14, 2018
1 parent e19d503 commit 8186136
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ Changes

All issue numbers are relative to https://github.com/smnorris/pgdata/issues.

0.0.8
------------------
- fail better when `geom_type` is not provided when dumping to FileGDB (#4)
- require psycopg2 as psycopg2-binary (#12)
- load sql queries on demand rather than all at once

0.0.7 (2018-02-16)
------------------
- update bc2pg to work with bcdata 0.2.0
Expand Down
4 changes: 3 additions & 1 deletion pgdata/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,14 @@ def pg2ogr(self, sql, driver, outfile, outlayer=None, column_remap=None,
s_srs='EPSG:3005', t_srs='EPSG:3005', geom_type=None, append=False):
"""
A wrapper around ogr2ogr, for quickly dumping a postgis query to file.
Suppported formats are ["ESRI Shapefile", "GeoJSON", "FileGDB"]
Suppported formats are ["ESRI Shapefile", "GeoJSON", "FileGDB", "GPKG"]
- for GeoJSON, transforms to EPSG:4326
- for Shapefile, consider supplying a column_remap dict
- for FileGDB, geom_type is required
(https://trac.osgeo.org/gdal/ticket/4186)
"""
if driver == 'FileGDB' and geom_type is None:
raise ValueError('Specify geom_type when writing to FileGDB')
filename, ext = os.path.splitext(os.path.basename(outfile))
if not outlayer:
outlayer = filename
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
psycopg2
psycopg2-binary
sqlalchemy
sqlalchemy-utils
geoalchemy2
Expand Down

0 comments on commit 8186136

Please sign in to comment.