Skip to content

Commit

Permalink
Added geoparquet format
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Nov 20, 2023
1 parent 3ad40c8 commit b2932b1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,18 @@ def ogr_export(query, outputtype, working_dir, dump_temp_path, params):
)
run_ogr2ogr_cmd(cmd)

if outputtype == RawDataOutputType.GEOPARQUET.value:
cmd = """ogr2ogr -overwrite -f Parquet {export_path} PG:"host={host} port={port} user={username} dbname={db} password={password}" -sql @"{pg_sql_select}" -lco ENCODING=UTF-8 -progress""".format(
export_path=dump_temp_path,
host=db_items.get("host"),
port=db_items.get("port"),
username=db_items.get("user"),
db=db_items.get("dbname"),
password=db_items.get("password"),
pg_sql_select=query_path,
)
run_ogr2ogr_cmd(cmd)

if outputtype == RawDataOutputType.PGDUMP.value:
cmd = """ogr2ogr -overwrite --config PG_USE_COPY YES -f PGDump {export_path} PG:"host={host} port={port} user={username} dbname={db} password={password}" -sql @"{pg_sql_select}" -lco SRID=4326 -progress""".format(
export_path=dump_temp_path,
Expand Down
1 change: 1 addition & 0 deletions src/validation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class RawDataOutputType(Enum):
GEOPACKAGE = "gpkg"
PGDUMP = "sql"
CSV = "csv"
GEOPARQUET = "parquet"
if ENABLE_TILES:
MBTILES = "mbtiles"
PMTILES = "pmtiles" ## EXPERIMENTAL
Expand Down

0 comments on commit b2932b1

Please sign in to comment.