Hi Martin,
thank you, that has solved my problem with the missing BursaWolfParameter!
But now, I've got another one :(
The result of my transformation based on the epsg-hsql factory is absolute
unrealistic. If I put in a point in germany (Mainz), the transformation
returns a point in the middle of the Mediterranean Sea....
First, I'll give you the code:
> //create CRSs
> CoordinateReferenceSystem sourcecrs =
> FactoryFinder.getCRSAuthorityFactory("EPSG",
> null).createCoordinateReferenceSystem("EPSG:31466");
>
> CoordinateReferenceSystem targetcrs =
> FactoryFinder.getCRSAuthorityFactory("EPSG",
> null).createCoordinateReferenceSystem("EPSG:4326");
>
> //create Factory & initialize transformation
> CoordinateOperationFactory coFactory =
> FactoryFinder.getCoordinateOperationFactory(null);
> CoordinateOperation op = coFactory.createOperation(sourcecrs, targetcrs);
>
> Point2D.Double outPoint = new Point2D.Double();
>
> GeneralDirectPosition gdp = new GeneralDirectPosition(point.getX(),
> point.getY()); //"point" is given
>
> //transformation
> op.getMathTransform().transform(gdp, gdp);
>
> outPoint.x = gdp.getOrdinate(0);
> outPoint.y = gdp.getOrdinate(1);
>
> return outPoint;
>
The WKT-Strings for both CRS are:
sourcecrs:
> PROJCS["DHDN / Gauss-Kruger zone 2",
> GEOGCS["DHDN",
> DATUM["Deutsches Hauptdreiecksnetz",
> SPHEROID["Bessel 1841", 6377397.155, 299.1528128,
> AUTHORITY["EPSG","7004"]],
> TOWGS84[598.1, 73.7, 418.2, 0.202, 0.045, -2.455,
> 1.3819742018555456],
> AUTHORITY["EPSG","6314"]],
> PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
> UNIT["degree", 0.017453292519943295],
> AXIS["Geodetic latitude", NORTH],
> AXIS["Geodetic longitude", EAST],
> AUTHORITY["EPSG","4314"]],
> PROJECTION["Transverse Mercator", AUTHORITY["EPSG","9807"]],
> PARAMETER["central_meridian", 6.0],
> PARAMETER["latitude_of_origin", 0.0],
> PARAMETER["scale_factor", 1.0],
> PARAMETER["false_easting", 2500000.0],
> PARAMETER["false_northing", 0.0],
> UNIT["m", 1.0],
> AXIS["Northing", NORTH],
> AXIS["Easting", EAST],
> AUTHORITY["EPSG","31466"]]
>
(The TOWGS84[] params are included....yeah)
targetcrs:
> GEOGCS["WGS 84",
> DATUM["World Geodetic System 1984",
> SPHEROID["WGS 84", 6378137.0, 298.257223563,
> AUTHORITY["EPSG","7030"]],
> AUTHORITY["EPSG","6326"]],
> PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
> UNIT["degree", 0.017453292519943295],
> AXIS["Geodetic latitude", NORTH],
> AXIS["Geodetic longitude", EAST],
> AUTHORITY["EPSG","4326"]]
>
String of
System.out.println(op.getMathTransform());
> CONCAT_MT[PARAM_MT["Affine",
> PARAMETER["num_row", 3],
> PARAMETER["num_col", 3],
> PARAMETER["elt_0_0", 0.0],
> PARAMETER["elt_0_1", 1.0],
> PARAMETER["elt_1_0", 1.0],
> PARAMETER["elt_1_1", 0.0]],
> INVERSE_MT[PARAM_MT["Transverse_Mercator",
> PARAMETER["semi_major", 6377397.155],
> PARAMETER["semi_minor", 6356078.962818189],
> PARAMETER["central_meridian", 6.0],
> PARAMETER["latitude_of_origin", 0.0],
> PARAMETER["scale_factor", 1.0],
> PARAMETER["false_easting", 2500000.0],
> PARAMETER["false_northing", 0.0]]],
> PARAM_MT["Ellipsoid_To_Geocentric",
> PARAMETER["dim", 2],
> PARAMETER["semi_major", 6377397.155],
> PARAMETER["semi_minor", 6356078.962818189]],
> PARAM_MT["Affine",
> PARAMETER["num_row", 4],
> PARAMETER["num_col", 4],
> PARAMETER["elt_0_0", 1.000001381974202],
> PARAMETER["elt_0_1", 0.00001190219231973911],
> PARAMETER["elt_0_2", 0.00000021816645799929],
> PARAMETER["elt_0_3", 598.1],
> PARAMETER["elt_1_0", -0.00001190219231973911],
> PARAMETER["elt_1_1", 1.000001381974202],
> PARAMETER["elt_1_2", -0.00000097932498924126],
> PARAMETER["elt_1_3", 73.7],
> PARAMETER["elt_2_0", -0.00000021816645799929],
> PARAMETER["elt_2_1", 0.00000097932498924126],
> PARAMETER["elt_2_2", 1.000001381974202],
> PARAMETER["elt_2_3", 418.2]],
> PARAM_MT["Geocentric_To_Ellipsoid",
> PARAMETER["dim", 2],
> PARAMETER["semi_major", 6378137.0],
> PARAMETER["semi_minor", 6356752.314245179]],
> PARAM_MT["Affine",
> PARAMETER["num_row", 3],
> PARAMETER["num_col", 3],
> PARAMETER["elt_0_0", 0.0],
> PARAMETER["elt_0_1", 1.0],
> PARAMETER["elt_1_0", 1.0],
> PARAMETER["elt_1_1", 0.0]]]
>
Input point (GK2):
> X: 2662991.8008303666
> Y: 5543454.291966553
>
Outputcoordinates (WGS84):
> X: 21.42676670940244
> Y: 34.465205616192364
>
but they have to be:
> X: 8.27317386543231;
> Y: 50.0050926651181;
>
I know, that the underlying cause of the problem is sitting in front of the
computer, mostly.
Even though, I've checked the sample code, but I can't find the fault.
Help would be wonderful.
Best regards
Sebastian
Martin Desruisseaux-2 wrote:
>
> Wegert a écrit :
>> I have already created CRS's with an authority factory.
>> The created CRS returns the following informations with
>> "System.out.println(sourcecrs)":
>>
>> [...snip...]
>>
>> The problem is, that the BursaWolfParameter (TOWGS84[]) is missing!
>
> Which CRS authority factory was used? There is many of them: epsg-wkt,
> epsg-hsql, epgs-access, epsg-postgresql... Make sure that epsg-wkt is
> *not* in
> the class path, since this factory is know to not contains TOWGS84 info.
> Try
> epsg-hsql instead.
>
> Martin
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
--
View this message in context:
http://www.nabble.com/Google-Earth---Projection-tf2807194.html#a7872098
Sent from the geotools-gt2-users mailing list archive at Nabble.com.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users