[PROJ] Axis in LOCAL_CS

Even Rouault even.rouault at spatialys.com
Thu Oct 12 07:27:33 PDT 2023


Hi Javier,

I guess it would make sense to allow axisCount == 3 as well.

OGC 01-009 mentions:

"""7.3.10 LOCAL_CS
This indicates a local, ungeoreferenced coordinate system. Such 
coordinate systems are often
used in CAD systems. They can also be used for local surveys, where the 
relationship between
the surveyed site and the rest of the world is not important.
The number of AXIS clauses indicates the dimension of the local 
coordinate system."""

and the BNF "<local cs> = LOCAL_CS["<name>", <local datum>, <unit>, <axis>,
{,<axis>}* {,<authority>}]"

doesn't forbid 3 axis.

Even

Le 12/10/2023 à 16:16, Javier Jimenez Shaw via PROJ a écrit :
> 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.
> .___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__
>
> _______________________________________________
> PROJ mailing list
> PROJ at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/proj

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20231012/2c02a090/attachment.htm>


More information about the PROJ mailing list