diff options
Diffstat (limited to 'webmap-import')
-rwxr-xr-x | webmap-import | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/webmap-import b/webmap-import index c930730..c801b6d 100755 --- a/webmap-import +++ b/webmap-import @@ -289,7 +289,8 @@ def processOutputLayer(ds : gdal.Dataset, return importSources(dso=ds, lyr=lyr, sources=sources, cachedir=cachedir, extent=extent, dsoTransaction=dsTransaction, - lyrcache=lyrcache) + lyrcache=lyrcache, + force=force) def validate_sources(layers : dict[str, Any]) -> None: """Mangle and validate layer sources and import definitions""" @@ -394,6 +395,8 @@ def validateCacheLayer(ds : gdal.Dataset, name : str) -> bool: 'nullable': False, 'unique': True, 'width': 255 }, { 'name': 'last_updated', 'typ': ogr.OFTDateTime, 'nullable': False }, + { 'name': 'fingerprint', 'typ': ogr.OFTBinary, + 'nullable': False, 'width': 32 }, ] m = len(fields) n = defn.GetFieldCount() @@ -495,8 +498,11 @@ def areSourceFilesNewer(layername : str, microsecond=round(ms*1000000), tzinfo=tz ) - logging.debug('Found entry in layer cache for "%s", last_updated=%s', layername, - dt.isoformat(timespec='microseconds')) + fpr = feature.GetFieldAsBinary(2) if feature.IsFieldSetAndNotNull(2) else None + logging.debug('Found entry in layer cache for "%s", last_updated=%s, fingerprint=%s', + layername, + dt.isoformat(timespec='microseconds'), + fpr.hex() if fpr is not None else 'NULL') ret = int(dt.timestamp() * 1000000.) * 1000 < t if lyrcache.GetNextFeature() is not None: |