You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by "Martin Desruisseaux (Jira)" <ji...@apache.org> on 2021/09/24 08:54:00 UTC
[jira] [Resolved] (SIS-489) Inaccurate result for MGI Ferro
transform (see test case attached)
[ https://issues.apache.org/jira/browse/SIS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Desruisseaux resolved SIS-489.
-------------------------------------
Resolution: Not A Bug
I'm closing as "not a bug" because I believe that the bug is on the software that produced the expected values. In order to obtain those values, we need to replace a coordinate operation parameter value (the _Longitude rotation_ parameter) by a value taken elsewhere (the _Greenwich longitude_ value of the prime meridian). If it was the correct thing to do, I think that EPSG would have provided that value in the coordinate operation parameters instead of expecting us to ignore the longitude rotation parameter value. Maybe the slight difference between _Longitude rotation_ and _Greenwich longitude_ values is because the former is not a rotation to WGS84, but a rotation to MGI 1901, while the later is (maybe) a rotation to WGS84.
Please feel free to reopen this issue if above analysis is incorrect.
> 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.3.4#803005)