Hi Thom,
The following code is the basis of some working code that should get you
started.
Brett
import org.geotools.geometry.jts.JTS;
import org.geotools.referencing.CRS;
try {
// Create a transform from Web Mercator (WGS84) to GDA 94 MGA Zone 55
transform = CRS.findMathTransform( /* from */ CRS.decode("EPSG:3857"), /*
to */ CRS.decode("EPSG:28355"));
}
catch (FactoryException e) {
e.printStackTrace();
}
newPoint = (Point) JTS.transform(oldPoint, transform);
From: Thom DeCarlo [mailto:[email protected]]
Sent: Wednesday, 25 September 2013 5:17 AM
To: [email protected]
Subject: [Geotools-gt2-users] Need a coordinate conversion example
Hi,
I'm looking for a simple java example which converts a map coordinate (say,
38.8895° N, 77.0352° W, 575ft) to another coordinate system (geocentric, UTM,
or MGRS). Is such a thing possible with GeoTools? The CRS tutorial seems to
rely on the map frame display to mediate the conversion, but I don't want the
overhead of displaying the point on a map. I just need the numbers.
Thanks!
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users