[
https://issues.apache.org/jira/browse/SIS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Martin Desruisseaux closed SIS-489.
-----------------------------------
> Inaccurate result for MGI Ferro transform (see test case attached)
> ------------------------------------------------------------------
>
> Key: SIS-489
> URL: https://issues.apache.org/jira/browse/SIS-489
> Project: Spatial Information Systems
> Issue Type: Bug
> Components: Referencing
> Affects Versions: 1.0
> Reporter: Olivier Lhemann
> Assignee: Martin Desruisseaux
> Priority: Major
> Fix For: 1.1
>
>
> {code:java}
> public void TransformTest() throws FactoryException,
> MismatchedDimensionException, TransformException {
> double latitude = 46.72;
> double longitude = 16;
> double x = -25097.740155822;
> double y = 175686.952118893;
> CRSAuthorityFactory crsFactory = CRS.getAuthorityFactory("EPSG");
> CoordinateOperationAuthorityFactory opFactory =
> (CoordinateOperationAuthorityFactory) crsFactory;
> // MGI (Ferro) to WGS 84 (1)
> CoordinateOperation datumOperation =
> opFactory.createCoordinateOperation("3966");
> // MGI (Ferro) / Austria GK East Zone
> CoordinateReferenceSystem targetCRS =
> crsFactory.createCoordinateReferenceSystem("31253");
> // normalize the axis for the target
> targetCRS =
> AbstractCRS.castOrCopy(targetCRS).forConvention(AxesConvention.DISPLAY_ORIENTED);
> CoordinateOperation targetOperation =
> CRS.findOperation(datumOperation.getSourceCRS(), targetCRS, null);
> /*
> * We have two operations to concatenate
> */
> MathTransform step1 = datumOperation.getMathTransform().inverse();
> MathTransform step2 = targetOperation.getMathTransform();
> MathTransform completeTransform = MathTransforms.concatenate(step1,
> step2);
> /*
> * transform to x,y in one step
> */
> DirectPosition source = new DirectPosition2D(latitude, longitude);
> DirectPosition target = completeTransform.transform(source, null);
> double[] coordinate = target.getCoordinate();
> //System.out.println(operation.getSourceCRS().toString());
> Assert.assertEquals(x, coordinate[0], 0.1);
> Assert.assertEquals(y, coordinate[1], 0.1);
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)