Hi again,
I guess I found the solution for my Problem, on
http://www.epsg-registry.org/ I found for UTM zone 32N the code EPSG:32632,
which produces the same results as the transformation on the cited website
in the original post.
Furthermore I mixed up lon and lat in my example code.
Thanks anyway,
Stefan
_____
Von: Schuster Stefan [mailto:[email protected]]
Gesendet: Donnerstag, 14. Januar 2010 09:59
An: [email protected]
Betreff: [Geotools-gt2-users] (Newbie) transform WGS84 (lat/lon) to UTM32
Hi,
I'm new to GeoTools, therefore my question might be quiet simple.
What I want to do is to transform a coordinate from WGS84 to UTM32.
Based on the UserGuide found on
http://docs.codehaus.org/display/GEOTDOC/03+How+to+Transform+a+Geometry I
have the following code:
CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:4326");
CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:23032");
MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS);
GeometryFactory geometryFactory = JTSFactoryFinder
.getGeometryFactory(null);
Point p = geometryFactory.createPoint(new Coordinate(6,49));
Geometry tp = JTS.transform(p, transform);
System.out.println(tp.toString());
The output is: POINT (5328456.906858956 865342.1771206289)
According to http://home.hiwaay.net/~taylorc/toolbox/geography/geoutm.html
the UTM-Point should be somewhere at (280586 5431792) zone32 hemisphere N
I guess my major Problem is that I don't know where I can find the proper
codes for the parameter in CRS.decode(String code). Even the javadoc at
http://javadoc.geotools.fr/snapshot/org/geotools/referencing/CRS.html#decode
(java.lang.String) didn't help me.
Is at least the basic approach right or is there a totally different
solution for transforming?
Thanks in advance for any help
Stefan
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users