Hello Michael

Yes this is a bug is SIS. Actually the WKT formatting is okay, the bug is in the WKT parser. It should not be necessary to specify the “tgt_semi_major” and similar parameters. This parameter should be inferred from the ellipsoid.

Would you like to fill a JIRA issue on https://issues.apache.org/jira/browse/SIS ? Just putting the content of your email in the description would be enough. Otherwise I can do it if you prefer.

    Regards,

        Martin


Le 25/04/2021 à 03:33, Michael Arneson a écrit :

Hi Martin,
Thanks for your help.
When validating the previously mentioned transform, we encountered what looks to be a bug. We are unable to create a /CoordinateOperation/ from the WKT that comes from an existing /CoordinateOperation/ object.
The code below can be used to test this:

/        CoordinateOperationAuthorityFactory opFactory = (CoordinateOperationAuthorityFactory) CRS.getAuthorityFactory("EPSG");         CoordinateOperation opFromCode = opFactory.createCoordinateOperation("5630");
        String operationWKT = opFromCode.toWKT();
        WKTFormat wf = new WKTFormat(null, null);
        CoordinateOperation opFromWKT = (CoordinateOperation) wf.parseObject(operationWKT);/

When trying to execute this code the following error is returned:

    /org.apache.sis.io.wkt.UnparsableObjectException: Error in
    “COORDINATEOPERATION”: Missing value for “tgt_semi_major” parameter./

        /at org.apache.sis.io.wkt.Element.parseFailed(Element.java:383)/

        /at
        
org.apache.sis.io.wkt.GeodeticObjectParser.parseOperation(GeodeticObjectParser.java:2279)/

        /at
        
org.apache.sis.io.wkt.GeodeticObjectParser.parseObject(GeodeticObjectParser.java:306)/

        /at
        
org.apache.sis.io.wkt.AbstractParser.parseObject(AbstractParser.java:283)/

        /at
        
org.apache.sis.io.wkt.GeodeticObjectParser.parseObject(GeodeticObjectParser.java:244)/

        /at org.apache.sis.io.wkt.WKTFormat.parse(WKTFormat.java:753)/

        /at
        org.apache.sis.io.CompoundFormat.parseObject(CompoundFormat.java:317)/


Is this an issue that the WKT returned from CoordinateOperation/.toWKT() /is not returning all the necessary parameters or that WKTFormat/.parseObject(String) /is expecting parameters that are not needed.
Thanks
Michael

Reply via email to