If you import a file whose CRS contains a datum name formatted with
spaces or parentheses, and you convert to COPC during import, then PDAL
will 'normalise' the CRS WKT.
(It is not possible to create such a file using PDAL because it
normalises CRS during write, so the test file here was manually altered
using laspy.)
Later imports using --update-existing will fail because Kart checks
the tile's CRS (before PDAL normalisation) against the existing dataset
name (after PDAL normalisation), and fails because they were different.
THis change fixes the issue by comparing the two CRSes using GDAL's
OSRSpatialReference.IsSame() method, rather than a direct string
comparison. This is lax enough to return True when the WKT varies only
slightly.
Another option was to normalise all WKT during import by running it
through ExportToWkt() but I opted not to do this because:
it would cause other changes, e.g. changing WKT1 to WKT2
already-stored WKT would not be normalised so the problem would
persist for existing repos.
Description
Fix some non-homogenous CRS conflicts
If you import a file whose CRS contains a datum name formatted with spaces or parentheses, and you convert to COPC during import, then PDAL will 'normalise' the CRS WKT.
(It is not possible to create such a file using PDAL because it normalises CRS during write, so the test file here was manually altered using laspy.)
Later imports using
--update-existing
will fail because Kart checks the tile's CRS (before PDAL normalisation) against the existing dataset name (after PDAL normalisation), and fails because they were different.THis change fixes the issue by comparing the two CRSes using GDAL's
OSRSpatialReference.IsSame()
method, rather than a direct string comparison. This is lax enough to return True when the WKT varies only slightly.Another option was to normalise all WKT during import by running it through
ExportToWkt()
but I opted not to do this because:Related links:
Fixes #973.
Checklist: