<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Yes, thanks for these precisions. <br>
      Actually I have an issue, because in my procedure, I also use some
      geotools plugin, i.e. the WFSDatastore, in order to get the
      bounding box of a piece of feature collection from WFS, for which
      I've built a separated method.<br>
      This module depends on gt-opengis. Consequently I cannot run my
      full java routine, either I cannot generate the metadata (if the
      dependency gt-opengis is enabled), either i can generate the
      metadata but I cannot use my custom bbox (if gt-opengis is
      disabled).<br>
      <br>
      Would you have some example with ClassLoader that i could try to
      apply?<br>
      I thank you very much in advance for that.<br>
      <br>
      The other alternative for me, maybe would be to get the bounding
      box from WFS filtered layer, using Geotoolkit and not
      Geotools/WFsDatastore.<br>
      Would it be possible with Geotoolkit? In this case, it would allow
      me do not depending anymore on gt-opengis.<br>
      <br>
      For information this is the method I used with Geotools:<br>
      <br>
      <i>/** Get Species Distribution BBOX</i><i><br>
      </i><i>     * </i><i><br>
      </i><i>     * @param alphacode</i><i><br>
      </i><i>     * @return</i><i><br>
      </i><i>     */</i><i><br>
      </i><i>    public static ReferencedEnvelope
        getSpeciesBoundingBox(String alphacode){</i><i><br>
      </i><i>        </i><i><br>
      </i><i>        try{    </i><i><br>
      </i><i>            //WFS feature collection</i><i><br>
      </i><i>            Map<String, Serializable> params = new
        HashMap<String, Serializable>();</i><i><br>
      </i><i>            params.put(WFSDataStoreFactory.URL.key,
        "MyWFSGetCapabilities");</i><i><br>
      </i><i>            params.put(WFSDataStoreFactory.TIMEOUT.key, new
        Integer(60000));</i><i><br>
      </i><i>            </i><i><br>
      </i><i>            datastore =
        DataStoreFinder.getDataStore(params);</i><i><br>
      </i><i>            featureSource =
        datastore.getFeatureSource("mylayer");</i><i><br>
      </i><i>        </i><i><br>
      </i><i>            String cql = "attribute='"+value+"'";</i><i><br>
      </i><i>            Filter filter = CQL.toFilter(cql);</i><i><br>
      </i><i>            Query query = new Query("mylayer",filter);</i><i><br>
      </i><i>            SimpleFeatureCollection sfc =
        featureSource.getFeatures( query );</i><i><br>
      </i><i>            </i><i><br>
      </i><i>            </i><i><br>
      </i><i>            //bounds calculation</i><i><br>
      </i><i>            ReferencedEnvelope bounds = new
        ReferencedEnvelope();</i><i><br>
      </i><i>            SimpleFeatureIterator iterator =
        sfc.features();</i><i><br>
      </i><i>            try {</i><i><br>
      </i><i>                while( iterator.hasNext() ){</i><i><br>
      </i><i>                    SimpleFeature feature = (SimpleFeature)
        iterator.next();</i><i><br>
      </i><i>                bounds.include(feature.getBounds());</i><i><br>
      </i><i>            }</i><i><br>
      </i><i>                System.out.println( "Calculated Bounds:"+
        bounds );</i><i><br>
      </i><i>            }</i><i><br>
      </i><i>            finally {</i><i><br>
      </i><i>                if(iterator!=null){</i><i><br>
      </i><i>                    iterator.close();</i><i><br>
      </i><i>                }</i><i><br>
      </i><i>                </i><i><br>
      </i><i>            }</i><i><br>
      </i><i>            return bounds;</i><i><br>
      </i><i>        }catch(Exception e){</i><i><br>
      </i><i>            throw new RuntimeException("impossible to get
        bbox");</i><i><br>
      </i><i>        }   </i><i><br>
      </i><i>        </i><i><br>
      </i><i>    }</i><br>
      <br>
      Otherwise, do you know what is the status of what you precised
      below regarding Geotools? Do you know if Geotools developers
      intend to change this, or not?<br>
      Do you think would be good to copy as well to the geotools-dev
      mailing list to get their feedback?<br>
      <br>
      Thanks again<br>
      Emmanuel<br>
      <br>
      <br>
      Le 02/11/2012 12:52, Martin Desruisseaux a écrit :<br>
    </div>
    <blockquote cite="mid:5093B415.3050009@geomatys.fr" type="cite">Le
      02/11/12 18:36, Emmanuel Blondel a écrit :
      <br>
      <blockquote type="cite"> Now i know where was the problem.
        <br>
        The fact is that i'm also using GeoTools. And t seems there was
        a conflict with the gt-opengis library...To test, i've excluded
        this dependency, and it works fine.
        <br>
      </blockquote>
      <br>
      Yes, this is a known problem... GeoTools should change the package
      name of their interfaces, since they do not own the "org.opengis"
      namespace and do not participate to the OGC working group. It may
      be possible to allow the two libraries to co-exist with some
      tricky ClassLoader use, but I'm not sure if it would really work.
      <br>
      <br>
          Martin
      <br>
      <br>
      _______________________________________________
      <br>
      Geotoolkit mailing list
      <br>
      <a class="moz-txt-link-abbreviated" href="mailto:Geotoolkit@lists.osgeo.org">Geotoolkit@lists.osgeo.org</a>
      <br>
      <a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/geotoolkit">http://lists.osgeo.org/mailman/listinfo/geotoolkit</a>
      <br>
    </blockquote>
    <br>
  </body>
</html>