Description
What is the bug?
According to the GeoPackage specs, data in an "Undefined Cartesian SRS" should be saved with srs_id = -1: https://www.geopackage.org/spec/#r11.
In GDAL this was implemented in these PR's:
- reading: GeoPackage: Fix handling of invalid SRS ID #3286
- writing: GeoPackage: Fix handling of invalid SRS ID when writing #3312
However, for reading as well as writing srs_id=-1 the unit is set/expected to be "meter". So, only if the unit is meter, the srs_id in GPKG will be set to srs_id -1.
For information, in r-spatial (r-spatial/sf#2049) the choice was made to explicitly to use a WKT that specifies the units to be undefined when saving data without crs specified to GPKG, leading to a "custom CRS" being saved in the GPKG, so an srs_id >= 100.000 instead of -1, which doesn't seem to be according to the GPKG specs?
So following questions rise:
- Was it an active choice to use unit "meter"?
- Would it be more logical that for an "Undefined Cartesian SRS" in the spirit of the GPKG spec that the unit would also be "undefined"?
Issue surfaced when implementing support for "Undefined Cartesian SRS" in pyogrio: geopandas/pyogrio#368
Steps to reproduce the issue
xref: geopandas/pyogrio#368
Versions and provenance
All versions of GDAL
Additional context
No response