Skip to content

Commit 99c5f90

Browse files
fix(lcs): adds layer creation option and fixes encoding issue
1 parent 6aed9d4 commit 99c5f90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

overture2hdx/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ def export_shapefile(self, category_conn, table_name, category_name, dir_path):
423423
SELECT * FROM {table_name}
424424
WHERE ST_GeometryType(geom) = '{geom_type}'
425425
) TO '{export_filename}'
426-
WITH (FORMAT GDAL, SRS 'EPSG:4326', DRIVER 'ESRI Shapefile', ENCODING 'UTF-8')
426+
WITH (FORMAT GDAL, SRS 'EPSG:4326', DRIVER 'ESRI Shapefile', LAYER_CREATION_OPTIONS 'ENCODING=UTF-8,2GB_LIMIT=No')
427427
"""
428428
)
429429

@@ -583,7 +583,7 @@ def process_category(self, category_dict) -> Tuple[str, str, List[str]]:
583583
# Standard export for other formats
584584
filename = f"{dir_path}/{category_name}.{fmt}"
585585
category_conn.execute(
586-
f"COPY {table_name} TO '{filename}' WITH (FORMAT GDAL, SRS 'EPSG:4326', DRIVER '{format_drivers.get(fmt)}', ENCODING 'UTF-8')"
586+
f"COPY {table_name} TO '{filename}' WITH (FORMAT GDAL, SRS 'EPSG:4326', DRIVER '{format_drivers.get(fmt)}', LAYER_CREATION_OPTIONS 'ENCODING=UTF-8')"
587587
)
588588
export_time = time.time() - export_start
589589

0 commit comments

Comments
 (0)