-------- Original-Nachricht -------- Betreff: Re: [jump-devel] Projection with Geotools2 CRS Datum: Sat, 15 Sep 2007 18:22:55 -0700 Von: Jody Garnett <[EMAIL PROTECTED]> Antwort an: JUMP Developers <[EMAIL PROTECTED]> An: JUMP Developers <[EMAIL PROTECTED]> Referenzen: <[EMAIL PROTECTED]>
Hi Edgar: We have a different idea of simplicity ;-) I tend to use the utility class to get the job done. CoordinateReferenceSystem src = CRS.decode("EPSG:31467"); CoordinateReferenceSystem trg = CRS.decode("EPSG:4326"); MathTransform transform = CRS.findMathTransform( src, trg ); Geometry targetGeometry = JTS.transform( sourceGeometry, transform); This example and others are in the user guide: - http://docs.codehaus.org/display/GEOTDOC/01+CRS+Helper+Class Cheers, Jody > Hello All, > > because of all the comments related to projection (interfaces) , here > is an example of the simplicity in using GT2 CRS for > projection/transformation > > SNIPPET--> > CoordinateOperationFactory coFactory = > FactoryFinder.getCoordinateOperationFactory(null); > MathTransform transform; > src = > FactoryFinder.getCRSFactory(null).createFromWKT("PROJCS[\"DHDN / > Gauss-Kruger Zone 3\", GEOGCS[\"DHDN\", DATUM[\"Deutsches > Hauptdreiecksnetz\", SPHEROID[\"Bessel 1841\", 6377397.155, > 299.1528128, AUTHORITY[\"EPSG\",\"7004\"]], TOWGS84[598.1, 73.7, > 418.2, 0.2019999999999998, 0.04499999999999995, -2.4549999999999974, > 6.7], AUTHORITY[\"EPSG\",\"6314\"]], PRIMEM[\"Greenwich\", 0.0, > AUTHORITY[\"EPSG\",\"8901\"]], UNIT[\"degree of > angle\",0.017453292519943295], AXIS[\"Geodetic longitude\",EAST], > AXIS[\"Geodetic latitude\",NORTH], AUTHORITY[\"EPSG\",\"4314\"]], > PROJECTION[\"Transverse_Mercator\"], PARAMETER[\"semi_major\", > 6377397.155], PARAMETER[\"semi_minor\", 6356078.962818189], > PARAMETER[\"central_meridian\", 8.999999999999991], > PARAMETER[\"latitude_of_origin\", 0.0], PARAMETER[\"scale_factor\", > 1.0], PARAMETER[\"false_easting\", 3500000.0], > PARAMETER[\"false_northing\", 0.0], UNIT[\"metre\",1.0], > AXIS[\"Easting\",EAST], AXIS[\"Northing\",NORTH], > AUTHORITY[\"EPSG\",\"31467\"]]"); > //src = FactoryFinder.getCRSAuthorityFactory("EPSG", > null).createCoordinateReferenceSystem("EPSG:31467"); > trg = FactoryFinder.getCRSAuthorityFactory("EPSG", > null).createCoordinateReferenceSystem("EPSG:4326"); > CoordinateOperation co = coFactory.createOperation(src, trg); > transform = co.getMathTransform(); > <--SNIPPET > > the snippet is only rough cut out of my tests. It will not compile in > this state, but still it shows how easy it is with GT2 to get a > transformation (from WKT or EPSG ID, as you choose) for projecting > coordinates. The EPSG entries of the factory are of course > request-/listable by name(description). > > just trying to lobby for the GT2 library, as I get the impression the > list is a bit afraid of it ;). > > regards ede > _______________________________________________ jump-devel mailing list [EMAIL PROTECTED] http://lists.refractions.net/mailman/listinfo/jump-devel ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel