aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2025-07-23 15:18:46 +0200
committerGuilhem Moulin <guilhem@fripost.org>2025-07-23 15:21:24 +0200
commitaf7ca4caa8c263adcffe9433d9961e69f47ed23c (patch)
tree3d318b00eeb0eb7dc18c81a510906218fae1fe5f
parent7ffa6c549efcf2c85d56b4402110e5846a724f5f (diff)
MVT: Set directory mtime to most recent source mtime.
For consistency with raster handling.
-rw-r--r--export_mvt.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/export_mvt.py b/export_mvt.py
index e50620f..c3690a9 100644
--- a/export_mvt.py
+++ b/export_mvt.py
@@ -459,6 +459,8 @@ def exportMVT(ds : gdal.Dataset,
srs, extent = parseTilingScheme(default_options.get('tiling-scheme', None))
+ last_modified_ns = max(last_modified.values()) * 1000000 if len(last_modified) > 0 else None
+
export_layers = {}
mvtconf = {}
for layername, layerdef in layers.items():
@@ -591,6 +593,10 @@ def exportMVT(ds : gdal.Dataset,
dir_fd=dir_fd,
compress=compress_metadata)
+ if last_modified_ns is not None:
+ os.utime(mvtname, ns=(last_modified_ns, last_modified_ns),
+ dir_fd=dir_fd, follow_symlinks=False)
+
try:
# atomically exchange paths
rename_exchange(mvtname, dst, olddirfd=dir_fd)