gdal icon indicating copy to clipboard operation
gdal copied to clipboard

GDAL doesn't support simplified WKT2 strings

Open SunBlack opened this issue 1 year ago • 6 comments

I have extended our tool so that the user can generate the WKT string in various formats. I noticed that GDAL does not support all formats that PROJ supports. So adding WKT2_2015_SIMPLIFIED and WKT2_2019_SIMPLIFIED to exportToWkt would be nice.

Btw: Is it possible to also add an API that accepts the format as an enum? Currently it's a bit annoying to match an enum to string options in your own framework, only for GDAL to turn these strings back into a (PROJ) enum. An API equivalent to proj_as_wkt would be nice.

SunBlack avatar Jan 25 '24 12:01 SunBlack

Out of curiosity, why it would be nice? What is the positive side that wins the confusion that having more format options makes?

jratike80 avatar Jan 25 '24 12:01 jratike80

I have extended our tool so that the user can generate the WKT string in various formats. I noticed that GDAL does not support all formats that PROJ supports. So adding WKT2_2015_SIMPLIFIED and WKT2_2019_SIMPLIFIED to exportToWkt would be nice.

If you want to submit a pull request for that, that would be fine

Btw: Is it possible to also add an API that accepts the format as an enum?

I'm not to keen on that. That would complicate the API

rouault avatar Jan 25 '24 13:01 rouault

Out of curiosity, why it would be nice? What is the positive side that wins the confusion that having more format options makes?

Good question, if you ask this question, you would also have to ask why SFSQL is supported in spatial references, because if I look at the output of EPSG:4326:

GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433]]

This doesn't match really the description I found here.

We have an internal GUI tool with which we can display all spatial references from GDAL and the information we receive about them. Since the specification of WKT 2 is not freely accessible, I don't even know whether it makes sense to offer WKT 2 2015 and 2019, i.e. whether anything relevant has changed. For this reason, I am currently offering all options so that differences can be displayed using a specific example. I wanted to offer the simplified versions for completeness, in case we come across any tool that wants the data in this format - there must be some reason why PROJ offers this. Sadly even the code search doesn't help much and the PR where this was added (OSGeo/PROJ#1175) is a bit to big to see the differences. Maybe @rouault know why this was added there.

SunBlack avatar Jan 25 '24 13:01 SunBlack

. Since the specification of WKT 2 is not freely accessible

See https://proj.org/en/9.3/development/reference/cpp/cpp_general.html#general_doc_1standards for links to all WKT specifications, all freely accesible when using the OGC documents.

rouault avatar Jan 25 '24 13:01 rouault

. Since the specification of WKT 2 is not freely accessible

See https://proj.org/en/9.3/development/reference/cpp/cpp_general.html#general_doc_1standards for links to all WKT specifications, all freely accesible when using the OGC documents.

Ah good to know. Just found this.

SunBlack avatar Jan 25 '24 14:01 SunBlack

Just found this.

The ISO version is the same content as https://www.ogc.org/standard/wkt-crs/

rouault avatar Jan 25 '24 15:01 rouault