temporal: dont fail when registering maps with missing range file
If maps are linked to the GRASS GIS database with r.external -r those maps do not have a range file.
When trying to register them in a STRDS, the process fails because no map info is returned at all, meaning no north, south, ... info either. In consequence, NON-NULL constraints of the TGIS DB are violated.
This PR fixes the inconsistency, so I tagged it as a bug and added a backport label. If others feel different about it, please feel free to change the labels.
In case of a missing range file, now None/NULL is returned as range of map values together with a valid spatial extent.
The failing OSGeo4W test is unrelated. If there are no objections, I will merge and backport next week...
Why exactly do you want to support r.external -r for TGIS? A missing or empty range file can cause all sorts of problems with other modules. Particularly with temporal modules, often calling other modules for actual raster processing, error messages eventually caused by an empty range file might be difficult to interpret.
Why exactly do you want to support
r.external -rfor TGIS?
When using GDALs /vsicurl/ to link online raster data resources, even the -m flag for just reading metadata causes the the dataset to be read entirely if metadata is missing. For larger datasets that is a) time consuming and b) (almost) the same as downloading the whole thing.
I use r.external -r for NetCDF files on Thredds servers, but that can be equally releveant for COGs or the like if metadata is missing...
For the addon I have been working on (https://github.com/ninsbl/t.rast.import.netcdf) I may be able to create a range file from a known "valid range" of the data. Could that be helpful to avoid processing errors down the road?
A missing or empty range file can cause all sorts of problems with other modules. Particularly with temporal modules, often calling other modules for actual raster processing, error messages eventually caused by an empty range file might be difficult to interpret.
Is there somewhere documentation which kinds of modules require a range file? My usecase is having a set of linked data in a time series to spatio-temporal select from it for further processing. Do e.g. r.mapcalc, r.series, r.univar have problems when a range file is missing? I can imagine that r.colors can run into issues...
Maybe with a warning, we can allow people to risk shooting themselfs in the foot also here, as r.external -r probably does anyway?
...even the
-mflag for just reading metadata causes the the dataset to be read entirely if metadata is missing...
See #2381 for some tests and analysis.