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/23 16:30:00 UTC
[jira] [Commented] (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:comment-tabpanel&focusedCommentId=17419305#comment-17419305 ]
Martin Desruisseaux commented on SIS-489:
-----------------------------------------
Hello Olivier. I investigated this issue and I would like a confirmation of what should be the right answer. The core issue is with the value of the _longitude rotation_ parameter in the EPSG:3966 concatenated operation. It can be checked online in the EPSG registry as below.
* Go on https://epsg.org/concatenated-operation_3966/MGI-Ferro-to-WGS-84-1.html
* Click on _Source CRS: MGI (Ferro)_ for expanding details about the source CRS.
* In the expanded section, click on _Datum: Militar-Geographische Institut (Ferro)_.
* In the expanded datum section, click on _Prime Meridian: Ferro_.
* Note the value of the _Greenwich longitude_ parameter: it is *17°40'00" W*.
* Back to the main section, click on _Operation 1: MGI (Ferro) to MGI 1901 (1)_.
* Note the value of the _Longitude offset_ parameter: it is *17°39'46.02" W*.
So we are in the (unusual?) case where in order to rotate to the Greenwich longitude, the coordinate operation explicitly tells us to apply a rotation slightly different than the _Greenwich longitude_ value defined by the prime meridian. Apache SIS follows exactly the steps described by the EPSG:3966 coordinate operation, i.e. it applies a rotation of 17°39'46.02" W, even if it disagree with the _Greenwich meridian_ value declared in the prime meridian. I verified that if I force SIS to use a rotation of 17°40'00" W instead, then we get the values expected by the test case in the description. The table below summarizes the coordinates transformed by SIS:
|| Axis || Source coordinates || 17°39'46.02" W rotation || 17°40'00" W rotation ||
| X | 16°E | -25394.59 | -25097.74 |
| Y | 46.72°N | 175688.20 | 175686.95 |
The last column appears to be exactly the value expected by the test case. So my question is, how those expected values were computed? Are we sure that we want to ignore the longitude rotation declared in EPSG:3966 and use the _Greenwich longityde_ value instead?
> 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)