Jody Garnett a écrit :
> I am tracking changes needed when upgrading to GeoTools 2.4 on this page:
>
> http://udig.refractions.net/confluence/display/UDIG/GeoTools+2.4+for+uDig+Developers

Thanks for doing that!


> - CRSUtilities.getEnveleope( CRS ) ---> CRS.getEnvelope( CRS )
> 
> Can I confirm this change is to allow you to keep CRSUtilities class 
> "private"?

Yes, exactly. More methods from CRSUtilities may move later according the 
experience gained.


> If you have any packages you would not like uDig developers  to use
> by accident please let me know and I can "hide" them from the 
> classloader ...

The whole org.geotools.resources package and subpackages is supposed to be 
private...


> -  CRS.decode("EPSG:4326") ----> Now throws a FactoryException (it did 
> not used to)

Note that NoSuchAuthorityCodeException is a subclass of FactoryException, so 
the 
example given in the above-mentioned web page could be simplified as:

try {
     crs = CRS.decode("EPSG:4326"); //$NON-NLS-1$
} catch (FactoryException e) {
     throw (IOException) new IOException(
         Messages.WMSGeoResourceImpl_bounds_unavailable
     ).initCause( e );
}



> I am trying to understand why someone using this method would care to 
> see a FactoryException; rather then simply try the next authority - is 
> this a case where we could log the error and keep trying? Or is failing 
> required here?

The code already try different authority factories. The exception is thrown if 
every factories failed, in which case the exception from the "main" factory is 
propagated. Conceptually, FactoryException is the only exception. Other 
exceptions like NoSuchAuthorityCodeException are just more accurate description 
of what is going wrong, very similar to FileNotFoundException vs IOException.

We can not just log something there and returns an "empty" CRS, since the empty 
CRS would probably be completly wrong. In the CRS.decode(String) case, the user 
has the possibility to catch the exception and do some action himself.

        Martin

-------------------------------------------------------------------------
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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to