Hi again, Your code works fine, but only for the latitude!?
With your transformation code the UTM coordinates N 978077.7664007092 E 334064.125 result in lat: 8.8452338 degrees = 8 degrees, 50 minutes, 43 seconds lon: 7.4911148 degrees = 7 degrees, 29 minutes, 28 seconds But the manual conversion on http://www.ngs.noaa.gov/cgi-bin/utm_getgp.prl (with utm zone 31) results in 08 50 42.84189 N 358 30 31.98673 W which seems to be "more" correct, if I look at my world map. Or is 358:30:32W equivalent to 7:29:28E? I thought there are only 360 degrees "around" the world, an not 366. So 358:30:32W must be 1:29:28E... Sorry for my greenhorn questions, but I am not very versed in this geographical "stuff". I am a "normal" programmer :-) Martin Andrea Aime schrieb: > Martin Schmitz ha scritto: >> Hello, >> >> is there a way in GT2.2.0 to convert UTM coordinates to a "degrees, >> minutes, seconds" format? >> I found several classes in the org.geotools.referencing.operation.* >> package, but I don't know, how to use them... > > You can use the CRS class for setting up a transformation. > > CoordinateReferenceSystem utm = CRS.decode("EPSG:32632"); // utm 32n > CoordinateReferenceSystem wgs84 = CRS.decode("EPSG:4326"); // lat/lon > MathTransform t = CRS.findMathTransform(utm, wgs84); > t.transform(...) > > that would give you coordinates in lat/lon, but in decimal > degrees, not degrees, minutes, seconds. I don't know if we have a class > to perform the latter conversion, afaik JScience has something > thought. > > Hope this helps > > Cheers > Andrea > ------------------------------------------------------------------------- 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
