I was confused by grade unit too, I thought it was radian unit!
BTW it's shame that radian unit didn't get more popular, 400 is much cooler 
than 360 or 2PI! ;)

Ok now I'm using hints for creating CRS. I try with 
hints.put(Hints.FORCE_STANDARD_AXIS_UNITS, Boolean.TRUE) to deal with degree 
unit for EPSG:27572 but.. it is still in grade! :(

But are we agree that the imprecision in my sample comes from this confusion 
between degree and grade?


-----Message d'origine-----
De : Martin Desruisseaux [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 19 avril 2007 09:57
À : zze-M2S FRISON V ext RD-BIZZ-SOP
Cc : [email protected]; Vincent Frison
Objet : Re: [Geotools-gt2-users] WGS84 to Lambert2e transforming

zze-M2S FRISON V ext RD-BIZZ-SOP a écrit :
> GeoTools is not bugged, it's about my use...

I would rather said a lack of documentation of Geotoools. Don't worry, we 
realize that this is one of Geotools weakness; many users had issues with CRS 
(among other parts) because informations is hard to find in Geotools. And of 
course Geotools do have bugs too, so reports that can help us to find them are 
useful.


> But even if add the "true" argument in CRS.decode() I have the same 
> values! :( In fact WKTs are exactly the same: EPSG:4326 are still in grade 
> units (EPSG:4326 was already in degree units before adding the extra 
> argument).
> Should I upgrade to Geotools 2.4-SNAPSHOT?

This is one area where the behavior between 2.3 and 2.4 may be sligtly 
different; it may be related to http://jira.codehaus.org/browse/GEOT-1237 but 
I'm not sure; it will need more investigation.

I would recommand to stay with stable version (2.3) for now; it is safer. In 
the mean time posible workaround are:

1) Uses grade units as specified by EPSG, or
2) Set the hints yourself, as in the example below:

final Hints hints = new Hints();
hints.put(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE); 
hints.put(Hints.FORCE_STANDARD_AXIS_UNITS , Boolean.TRUE); // You may or may 
not set FORCE_STANDARD_AXIS_DIRECTIONS too, at your choice.
CRSAuthorityFactory crsFactory = FactoryFinder.getCRSAuthorityFactory("EPSG",
hints);
CoordinateReferenceSystem sourceCRS =
crsFactory.createCoordinateReferenceSystem("EPSG:xxxx");
CoordinateReferenceSystem targetCRS =
crsFactory.createCoordinateReferenceSystem("EPSG:4326");


Advantage of 2 is that you get more control on the factory behavior (it is the 
way that give you the maximum control actually; CRS.decode(String, boolean) is 
just a shortcut for convenience).

Does the CRS looks better that way?

        Martin

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to