Skip to content

GPKG: srs_id -1 for "Undefined cartesian SRS" has meter units, should this be "undefined" units? #9580

Closed
@theroggy

Description

@theroggy

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:

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

CC: @edzer , @martinfleis, @jorisvandenbossche

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions