From af7ca4caa8c263adcffe9433d9961e69f47ed23c Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 23 Jul 2025 15:18:46 +0200 Subject: MVT: Set directory mtime to most recent source mtime. For consistency with raster handling. --- export_mvt.py | 6 ++++++ 1 file changed, 6 insertions(+) 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) -- cgit v1.2.3