[geotk] WFS client

Guilhem guilhem.legal at geomatys.fr
Tue Sep 28 06:21:21 EDT 2010


hi yvan,

I have push a new version of the WFS client, with a flag allowing to 
send only POST request, because geoserver seems to have issues with XML 
filter in the GET request.
I ran the following piece of code on two open geoserver that i found on 
the net (http://apps.who.int/tools/geoserver/wfs and 
http://ogc.gbif.org/wfs)
The clients works i receive the feature :

public static void main(String[] args) throws URISyntaxException, 
DataStoreException, MalformedURLException, NoSuchAuthorityCodeException, 
FactoryException {

         // here the "true" means POST REQUEST
         WFSDataStore pDS = new WFSDataStore(new 
URI("http://ogc.gbif.org/wfs"), true);
         if (pDS != null) {

             PropertyName p = new DefaultPropertyName("geom");
             double[] min = {-10, -10};
             double[] max = {10, 10};
             CoordinateReferenceSystem crs = CRS.decode("EPSG:4326");
             DefaultBoundingBox env = new DefaultBoundingBox(min, max);
             env.setCoordinateReferenceSystem(crs);
             DefaultLiteral<Envelope> lit = new 
DefaultLiteral<Envelope>(env);
             Filter filter = new DefaultBBox(p, lit);
             FeatureReader reader = 
pDS.getFeatureReader(QueryBuilder.filtered(new 
DefaultName("http://gbif.org/geobon/demo", "cluster10"), filter));

             while (reader.hasNext()) {
                 System.out.println(reader.next());
             }
         } else {
             System.out.println("the datastore is null");
         }
     }

I hope, this will work for you.

Guilhem Legal



On 27/09/2010 17:54, Guilhem wrote:
> hello yvan,
>
> We didn't really try to use the geotk WFS client with either Geoserver 
> or ArcGis. At least if we have used it, it was with Constellation-SDI.
> I'll try to run some tests with Geoserver in the next days to see what 
> are the issues.
>
> Guilhem Legal
>
> On 27/09/2010 08:14, Riou Yvan N2A (DAS SDMOL) wrote:
>> Good morning,
>> Since some weeks, I'm trying to use geotoolkit-pending (with the last 
>> SNAPSHOT everyday) and particularly the WFS client (1.1.0) which 
>> seems to have inconsitencies while handling features from Geoserver 
>> (different versions) and ArcGIS Server (as WFS Server version 9.3.1) 
>> datastore. Are your tests against those WFS OK or do you also having 
>> problems ?
>> Thanks a lot for your works.
>> yvan.
>>
>>
>> _______________________________________________
>> Geotoolkit mailing list
>> Geotoolkit at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/geotoolkit
>>    
>
>
> _______________________________________________
> Geotoolkit mailing list
> Geotoolkit at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geotoolkit
>    

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geotoolkit/attachments/20100928/818d0544/attachment.html


More information about the Geotoolkit mailing list