Dear all,
I have seen some olderthreads on this topic, but I am still getting
non-sensical results.
I know the coordinates that I should get in CH1903 (well, at least what
I get in ArcMap fits with all other datasets...)
Coordinate p1WGS = new Coordinate(8.963944444444444,47.346805555555555);
I would expect values such as
Coordinate p1CH = new Coordinate(715253.258,245114.108);//approximate,
from arcmap
instead, the x is waaaay off:
x: 1.0735073726643294E7 y: 245114.46377226454
I have found an specification of the system that someone tunned
(referred to as 45555), that I imported
xx1903="PROJCS[\"CH1903_LV03\",GEOGCS[\"GCS_CH1903\",DATUM[\"D_CH1903\",SPHEROID[\"Bessel_1841\",6377397.155,299.1528128]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]],PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],PARAMETER[\"False_Easting\",600000],PARAMETER[\"False_Northing\",200000],PARAMETER[\"Scale_Factor\",1],PARAMETER[\"Azimuth\",90],PARAMETER[\"Longitude_Of_Center\",7.439583333333333],PARAMETER[\"Latitude_Of_Center\",46.95240555555556],UNIT[\"Meter\",1]]";
Well, this at least lands in the same country, roughly: (proj x :
715167.3397977804 proj y: 244895.68318630898)
This is what the original EPSG21781 shows, when exported to WKT:
PROJCS["CH1903 / LV03",
GEOGCS["CH1903",
DATUM["CH1903",
SPHEROID["Bessel 1841", 6377397.155, 299.1528128,
AUTHORITY["EPSG","7004"]],
AUTHORITY["EPSG","6149"]],
PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
UNIT["degree", 0.017453292519943295],
AXIS["Longitude", EAST],
AXIS["Latitude", NORTH],
AUTHORITY["EPSG","4149"]],
PROJECTION["Hotine_Oblique_Mercator"],
PARAMETER["longitude_of_center", 7.439583333333333],
PARAMETER["latitude_of_center", 46.95240555555556],
PARAMETER["azimuth", 90.0],
PARAMETER["scale_factor", 1.0],
PARAMETER["false_easting", 600000.0],
PARAMETER["false_northing", 200000.0],
PARAMETER["rectified_grid_angle", 90.0],
UNIT["m", 1.0],
AXIS["x", EAST],
AXIS["y", NORTH],
AUTHORITY["EPSG","21781"]]
The only difference I see is the Projection.
example code:
public static Coordinate projectPoint (Coordinate coord, String
sourceSys, String targetSys) {
GeometryFactory geometryFactory = new GeometryFactory();
Point point = geometryFactory.createPoint(coord);
CoordinateReferenceSystem sourceCRS =
CRS.decode(sourceSys);//WGS84 EPSG code
CoordinateReferenceSystem targetCRS = CRS.decode(targetSys);
//EPSG:21781 for CH_LV03
MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS,
Point newpt = JTS.transform( point, transform);
return newgeom.getCoordinates()[0];
}
I am using the snapshot version of the gt2.4 with the epsg hsql jar.
Thanks heaps
Martin
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users