Daniele Romagnoli a écrit :
> However, I'm a bit confused about where I need to set Default Hints. All
> MyFormatFactory classes implement GridFormatFactorySpi.
> I guess I need to do something like this (however, I'm not sure about
> this):
>     static {
>           Hints hints = new Hints(Hints.USE_JAI_IMAGEREAD, Boolean.TRUE);
>           Hints defHints = GeoTools.getDefaultHints();
>           defHints.add(hints);
>           GeoTools.init(defHints);
>        }

Calls to GeoTools.init(...) or to Hints.putSystemDefault(...) are expected to
happen in user-code only. It should never happen anywhere in GeoTools library.
If the goal is to use Boolean.TRUE as the default value when the
USE_JAI_IMAGEREAD hint is not specified, then this handling should be performed
in the FormatFactorySpi constructor:

   public FormatFactorySpi(Hints hints) {
       boolean useJaiImageRead = true; // Default value
       if (hints != null) {
           Boolean hint = (Boolean) hints.get(Hints.USE_JAI_IMAGE_READ);
           if (hint != null) {
               useJaiImageRead = hint.booleanValue();
           }
       }
   }



        Martin

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to