Not really ;) ...

after posting the snippet mentioned, i also had a look in your docs and found the utility class, even posted about it in the list (see attachment). once again .. respect to you geotools folks, you really made a nice feature even more handy by creating the utility class.

just one question .. what is this bursa wolf parameter option?

Also I stumbled across a problem converting DHDN / Gauss Kruger 3 into WGS84 with the GT2.3 EPSG. It was impossible due to Bursa Wolf (?*) parameters missing. Setting a GT2.3 parameter named LENIENT_DATUM_SHIFT <http://udig.refractions.net/docs/api-geotools/org/geotools/factory/Hints.html#LENIENT_DATUM_SHIFT> enabled the conversion but gave inexact results. Maybe the dialogue should enable the user to set options like that to modify the way GT2.3 works? Finally I compared the wkt strings from GT2.3 and my original cts.0.1a and found some missing parameters in the DHDN definition. Using the old WKT string it worked perfectly and gave nearly identical results.

cheers too .. ede
--

Stefan Steiniger wrote:
-------- 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


--
public class WhoDidIt{ // A comment. I love comments private static Person sender;

 public static void main (String[] foo){

 sender = new Person();
 sender.setName(new String[]{"Edgar", "Soldin"});

 Address address = new Address();
 address.setStreet("Stadtweg 119");
 address.setZip(39116);
 address.setCity("Magdeburg");
 address.setCountry("Germany");

 sender.setAddress(address);

 sender.setMobilePhone(" +49(0)171-2782880 ");
 sender.setWebSiteUrl(" http://www.soldin.de ");
 sender.setEmail(" [EMAIL PROTECTED] ");
 sender.setPGPPublicKey(" http://www.soldin.de/edgar_soldin.asc ");
 sender.setGender(true);

 System.out.println(sender.toString());
 }
}

--- Begin Message ---
Hey Larry,
>   More seriously - are you saying that we can just add a GT2 jar, wrap
> it in an interface like some of the guys have been kicking around, and
> get instant transformation?
>   
make it 4 jars and use given jts objects .. voila, see:
http://docs.codehaus.org/display/GEOTDOC/01+CRS+Helper+Class

what i did originally was filtering geometries coordinates, create and 
replace new geometries with them and save the old ones for a possible 
'UNDO'.
it looks like by version gt2.3, they have a utility class that can 
manipulate geometries directly. *nice*
>   What would we do for a start?   Add a Layer->reproject function?
>   
to check how good it works yes... i suggested a user interface earlier 
this year.. maybe you want to check
http://www.jump-project.org/pipermail/jump-devel/2007-July/000629.html

re-regards ede
> regards,
> Larry
>
>
>
> On 9/13/07, Stefan Steiniger <[EMAIL PROTECTED]> wrote:
>   
>> probably rather to this list ;)
>>
>> -------- Original-Nachricht --------
>> Betreff: [jump-devel] Projection with Geotools2 CRS
>> Datum: Thu, 13 Sep 2007 21:00:44 +0200
>> Von: Edgar Soldin <[EMAIL PROTECTED]>
>> Antwort an: JUMP Developers <[EMAIL PROTECTED]>
>> An: JUMP Developers <[EMAIL PROTECTED]>
>>
>> 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
>>
>> --
>> public class WhoDidIt{ // A comment. I love comments
>>   private static Person sender;
>>
>>   public static void main (String[] foo){
>>
>>   sender = new Person();
>>   sender.setName(new String[]{"Edgar", "Soldin"});
>>
>>   Address address = new Address();
>>   address.setStreet("Stadtweg 119");
>>   address.setZip(39116);
>>   address.setCity("Magdeburg");
>>   address.setCountry("Germany");
>>
>>   sender.setAddress(address);
>>
>>   sender.setMobilePhone(" +49(0)171-2782880 ");
>>   sender.setWebSiteUrl(" http://www.soldin.de ");
>>   sender.setEmail(" [EMAIL PROTECTED] ");
>>   sender.setPGPPublicKey(" http://www.soldin.de/edgar_soldin.asc ");
>>   sender.setGender(true);
>>
>>   System.out.println(sender.toString());
>>   }
>> }
>>
>> _______________________________________________
>> 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
>>
>>     
>
>
>   


-- 
public class WhoDidIt{ // A comment. I love comments 
  private static Person sender;

  public static void main (String[] foo){

  sender = new Person();
  sender.setName(new String[]{"Edgar", "Soldin"});

  Address address = new Address();
  address.setStreet("Stadtweg 119");
  address.setZip(39116);
  address.setCity("Magdeburg");
  address.setCountry("Germany");

  sender.setAddress(address);

  sender.setMobilePhone(" +49(0)171-2782880 ");
  sender.setWebSiteUrl(" http://www.soldin.de ");
  sender.setEmail(" [EMAIL PROTECTED] ");
  sender.setPGPPublicKey(" http://www.soldin.de/edgar_soldin.asc ");
  sender.setGender(true);

  System.out.println(sender.toString());
  }
}


-------------------------------------------------------------------------
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

--- End Message ---
-------------------------------------------------------------------------
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

Reply via email to