aboutsummaryrefslogtreecommitdiffstats
path: root/export_mvt.py
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2025-07-23 09:56:59 +0200
committerGuilhem Moulin <guilhem@fripost.org>2025-07-23 15:21:20 +0200
commit7ffa6c549efcf2c85d56b4402110e5846a724f5f (patch)
tree697fd2594bbb77d9e80f73e34c62002ae2f68b8b /export_mvt.py
parent91abd89d67748a1e057d1299698d506613ee0f9f (diff)
Add logic to export raster files (as COG).
Raster data is not stored in the PostGIS database. Instead, the mtime of the target directory is used to determine whether the COG is up to date. Add a new flag --metadata-compress for JSON metadata compression (which also applies to MVT metadata), and --rasterdir for the target raster directory.
Diffstat (limited to 'export_mvt.py')
-rw-r--r--export_mvt.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/export_mvt.py b/export_mvt.py
index 8d90129..e50620f 100644
--- a/export_mvt.py
+++ b/export_mvt.py
@@ -450,7 +450,8 @@ def exportMVT(ds : gdal.Dataset,
drvname : str = 'MVT',
default_options : dict[str,Any]|None = None,
tile_extension : str = '.pbf',
- compress : bool = False) -> None:
+ compress : bool = False,
+ compress_metadata : bool = False) -> None:
"""Export some layers to MVT."""
drv = gdal.GetDriverByName(drvname)
if drv is None:
@@ -588,7 +589,7 @@ def exportMVT(ds : gdal.Dataset,
last_modified=last_modified,
last_updated=creation_time // 1000000),
dir_fd=dir_fd,
- compress=compress)
+ compress=compress_metadata)
try:
# atomically exchange paths