[PROJ] Axis in LOCAL_CS

Javier Jimenez Shaw j1 at jimenezshaw.com
Thu Oct 12 07:16:15 PDT 2023


This is just a question, not necessarily a bug.
I'm just playing with arbitrary CRS, in this case with 3 dimensions.
Producing the WKT1 output from WKT2 works

projinfo 'ENGCRS["Engineering SRS",
  EDATUM["datum",ANCHOR["anchor"]],
  CS[Cartesian,3],
    AXIS["easting (X)",east, ORDER[1], LENGTHUNIT["US survey
foot",0.304800609601219]],
    AXIS["northing (Y)",north, ORDER[2], LENGTHUNIT["US survey
foot",0.304800609601219]],
    AXIS["elevation (z)",up, ORDER[3], LENGTHUNIT["US survey
foot",0.304800609601219]]]' -o wkt1_gdal

WKT1:GDAL string:
LOCAL_CS["Engineering SRS",
    LOCAL_DATUM["datum",32767],
    UNIT["US survey foot",0.304800609601219],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH],
    AXIS["Elevation",UP]]

But later using that WKT1 string fails:
projinfo 'LOCAL_CS["Engineering SRS",
    LOCAL_DATUM["datum",32767],
    UNIT["US survey foot",0.304800609601219],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH],
    AXIS["Northing",UP]]'
input string: parsing of user string failed: buildCS: unexpected AXIS count
for LOCAL_CS

The code is this (src/iso19111/io.cpp):

        } else if (ci_equal(parentNodeName, WKTConstants::LOCAL_CS)) {
            if (axisCount == 0) {
                auto unit =
                    buildUnitInSubNode(parentNode,
UnitOfMeasure::Type::LINEAR);
                if (unit == UnitOfMeasure::NONE) {
                    unit = UnitOfMeasure::METRE;
                }
                return CartesianCS::createEastingNorthing(unit);
            } else if (axisCount == 1) {
                csTypeCStr = "vertical";
            } else if (axisCount == 2) {
                csTypeCStr = "Cartesian";
            } else {
                throw ParsingException(
                    "buildCS: unexpected AXIS count for LOCAL_CS");
            }

Is that limited in purpose? I was not able to find anything explicit in the
standard about the number of axis in WKT1 LOCAL_CS

Thanks.
.___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20231012/89bd1a9e/attachment.htm>


More information about the PROJ mailing list