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
On Thu, Apr 15, 2021 at 8:05 AM Martin Desruisseaux <
[email protected]> wrote:
> Hello Michael
>
> Le 15/04/2021 à 02:18, Michael Arneson a écrit :
>
> I was not able to create the transformations by adding the parameters
> "src_semi_major", "dst_semi_major", however, I was able to create the
> transformation when I added in the parameters "tgt_semi_major", "
> tgt_semi_minor".
>
> It is possible that "src_semi_major" and "src_semi_minor" are required as
> well. But if it works without them it is worth to try.
>
> Could you take a look at the attached file and let me know if the
> modifications I have made to the WKTs are correct?
>
> It seems close. But in the following parameters:
>
> PARAMETER["tgt_semi_major",6378137.0],
> PARAMETER["tgt_semi_minor",298.257223563]
>
> the 298.257… value is the inverse flattening factor. Value for semi-minor
> axis should rather be 6356752.314245179 (computed from semi-major and
> inverse flattening factor).
>
> Martin
>
>
>
--
*Michael Arneson*
*Software Engineer*
*Office:* +1 (713) 975-7434
[email protected]
*INT *| *Empowering Visualization*