Hi,
is it possible to transform a WGS84 coordinate to EPSG:20249 without using the
EPSG geodetic dataset?
I tried to find a CoordinateOperation based on EPSG:20249’s WKT 1.0 definition
which includes the toWGS84 parameters, but I got the following exception:
org.opengis.referencing.operation.OperationNotFoundException: Coordinate
conversion of transformation from system “ellipsoidal” to “Cartesian” has not
been found.
at
org.apache.sis.referencing.operation.transform.CoordinateSystemTransform.create(CoordinateSystemTransform.java:212)
at
org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory.createCoordinateSystemChange(DefaultMathTransformFactory.java:1235)
at
org.apache.sis.referencing.operation.CoordinateOperationFinder.createOperationStep(CoordinateOperationFinder.java:499)
at
org.apache.sis.referencing.operation.CoordinateOperationFinder.createOperation(CoordinateOperationFinder.java:269)
at
org.apache.sis.referencing.operation.CoordinateOperationFinder.createOperationStep(CoordinateOperationFinder.java:329)
at
org.apache.sis.referencing.operation.CoordinateOperationFinder.createOperation(CoordinateOperationFinder.java:258)
at
org.apache.sis.referencing.operation.DefaultCoordinateOperationFactory.createOperation(DefaultCoordinateOperationFactory.java:731)
at org.apache.sis.referencing.CRS.findOperation(CRS.java:310)
at crssample.Wkt1Test.epsg20249(Wkt1Test.java:31)
….
Caused by: java.lang.IllegalArgumentException: Incompatible coordinate system
types.
at
org.apache.sis.referencing.cs.CoordinateSystems.swapAndScaleAxes(CoordinateSystems.java:290)
at
org.apache.sis.referencing.operation.transform.CoordinateSystemTransform.create(CoordinateSystemTransform.java:191)
... 31 more
My sample code is the following:
CoordinateReferenceSystem fromWkt = CRS.fromWKT(
"PROJCS[\"AGD66 / AMG zone
49\",GEOGCS[\"AGD66\",DATUM[\"Australian_Geodetic_Datum_1966\",SPHEROID[\"Australian
National
Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7003\"]],TOWGS84[-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29],AUTHORITY[\"EPSG\",\"6202\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4202\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",111],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",10000000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"20249\"]]");
CoordinateOperation coordinateOperation =
CRS.findOperation(CommonCRS.WGS84.geographic(), fromWkt, null);
DirectPosition2D wgs84Position = new DirectPosition2D(-37.84,
114.0);
DirectPosition epsg20249Position =
coordinateOperation.getMathTransform().transform(wgs84Position, null);
Assert.assertArrayEquals(new double[] { 763850.6420409812,
5807560.942144813 }, epsg20249Position.getCoordinate(), 1e-3f);
Thanks in advance!
Best Regards,
Steve
Diese E-Mail wurde versandt im Auftrag des Unternehmens Intergraph Ges.m.b.H.
Vertretungsberechtigte Geschäftsführer: Maximilian Weber
Sitz der Gesellschaft: Margaretenstraße 70/I/1, 1050 Wien, Österreich, Tel. +43
(1) 9610567-0
Eingetragen beim Handelsgericht Wien, Firmenbuch-Nr.: FN 116859 b
Umsatzsteuer-Identifikationsnummer / VAT-ID: ATU15138401, Steuer-Nummer:
264/4807
This E-Mail has been sent on behalf of the company Intergraph Ges.m.b.H.
Authorised Managing Directors: Maximilian Weber
Registered office and Austrian headquarters: Margaretenstr. 70/I/1, 1050 Wien,
Austria, Tel. +43 (1) 9610567-0
The company is recorded at the commercial court of Vienna under the company
register number FN 116859 b
VAT-ID: ATU15138401, Austrian Tax ID: 264/4807
Diese E-Mail (mit zugehörigen Dateien) enthält möglicherweise Informationen,
die vertraulich sind, dem Urheberrecht unterliegen oder ein Geschäftsgeheimnis
darstellen. Falls Sie diese Nachricht irrtümlicherweise erhalten haben,
benachrichtigen Sie uns bitte umgehend, indem Sie eine Antwort senden, und
löschen Sie bitte diese E-Mail und Ihre Antwort darauf. Sämtliche aufgeführten
Ansichten oder Meinungen sind ausschließlich diejenigen des Autors und
entsprechen nicht notwendigerweise denen des Unternehmens Intergraph.
This E-Mail (and any attachments) may be confidential and protected by legal
privilege. If you are not the intended recipient please notify us immediately
by replying to the sender and delete this E-Mail and your reply from your
system. All the views and opinions published here are solely based on the
author's own opinion and should not be considered necessarily as reflecting the
opinion of Intergraph.