Interesting, well if the old wfs module is working the same way - then it
may be something odd about the configuration of the WFS service you are
trying to reach?
In any case I will gather up your email and report the issue:
https://jira.codehaus.org/browse/GEOT-4889
Jody Garnett
On Tue, Sep 2, 2014 at 7:29 AM, <list-...@web.de> wrote:
> Thats the thing. I wasn't sure if it is a bug. The same behavior appears
> in the old version of the wfs modul.
> Maybe somebody could just execute the code and see if the CRS is in the
> created FeatureCollection.
> I can create the Bug report without problem. It's just a question if it is
> me beeing dumm or somthing real. :-)
>
> Jonas
>
> *Gesendet:* Dienstag, 02. September 2014 um 15:48 Uhr
>
> *Von:* "Jody Garnett" <jody.garn...@gmail.com>
> *An:* list-...@web.de
> *Cc:* "geotools geotools-gt2-users@lists. sourceforge. net" <
> geotools-gt2-users@lists.sourceforge.net>
> *Betreff:* Re: [Geotools-gt2-users] Question | reading out a
> FeatureCollection from an WFS
> Cool - if you are testing with wfs-ng on 12-RC1 then we want a bug
> report as quick as we can :)
>
> Jody Garnett
>
> On Tue, Sep 2, 2014 at 6:23 AM, <list-...@web.de> wrote:
>>
>> Maybe I described it wrong.
>> I did use the new wfs-ng module from the Geotools 12-RC1 version. It
>> behaves the same way as the old wfs module.
>>
>> Jonas
>> *Gesendet:* Freitag, 29. August 2014 um 18:42 Uhr
>> *Von:* "Jody Garnett" <jody.garn...@gmail.com>
>> *An:* list-...@web.de
>> *Cc:* "geotools geotools-gt2-users@lists. sourceforge. net" <
>> geotools-gt2-users@lists.sourceforge.net>
>> *Betreff:* Re: [Geotools-gt2-users] Question | reading out a
>> FeatureCollection from an WFS
>> Can you please try with GeoTools 12-RC1 - we wrote a new WFS client
>> that needs testing, and since it is a replacement any trouble you are
>> having with the old client won't be fixed.
>> --
>> Jody
>>
>> Jody Garnett
>>
>> On Fri, Aug 29, 2014 at 6:50 AM, <list-...@web.de> wrote:
>>>
>>> Hello,
>>>
>>> I'm reading out Features from a WFS (using Windows 7 x64, Java 7,
>>> GeoTools 12-RC1 [gt-wfs, gt-epsg-hsql and other modules]).
>>>
>>> The FeatureCollection I create doesn't have a CRS. Why is that?
>>> And what do the last four warnings mean? Can I do anything to prevent
>>> them?
>>> When I use the new gt-wfs-ng module or use the older GeoTools 11.1 the
>>> warnings stay the same.
>>>
>>> Here is my code:
>>> _____________________________________________________
>>> String getCapabilities = "
>>> http://suite.opengeo.org/geoserver/wfs?service=wfs&version=1.1.0&request=GetCapabilities
>>> ";
>>> Map<String, String> connectionParameters = new HashMap<>();
>>> connectionParameters.put("WFSDataStoreFactory:GET_CAPABILITIES_URL",
>>> getCapabilities );
>>>
>>> DataStore dataStore = DataStoreFinder.getDataStore(connectionParameters);
>>> WFSDataStore wfsDataStore = (WFSDataStore) dataStore;
>>>
>>> String featureTypeName = "medford:hydro";
>>>
>>> Query query = new Query();
>>>
>>> query.setCoordinateSystem(wfsDataStore.getFeatureSource(featureTypeName).getInfo().getCRS());
>>> query.setMaxFeatures(5);
>>>
>>> SimpleFeatureCollection simpleFeatureCollection =
>>> wfsDataStore.getFeatureSource(featureTypeName).getFeatures(query);
>>>
>>> int i = 0;
>>> try (SimpleFeatureIterator iterator =
>>> simpleFeatureCollection.features()){
>>> while(iterator.hasNext() ){
>>> SimpleFeature feature = iterator.next();
>>> System.out.println("Feature " + i + ": " + feature);
>>> i++;
>>> }
>>> }
>>> _____________________________________________________
>>>
>>>
>>>
>>>
>>> I get following Warnings in the console:
>>> _____________________________________________________
>>> 2014-08-29T15:31:31.298+0200 WARNING Creating location with null
>>> CoordinateReferenceSystem - did you mean to setCRS?
>>> 2014-08-29T15:31:31.308+0200 WARNING Creating the_geom with null
>>> CoordinateReferenceSystem - did you mean to setCRS?
>>> 2014-08-29T15:31:31.587+0200 WARNING results[ class java.lang.String ]
>>> is not of type class net.opengis.wfs.ResultTypeType
>>> 2014-08-29T15:31:31.597+0200 WARNING Binding: {
>>> http://www.opengis.net/ows}ServiceType does not declare a target type
>>> 2014-08-29T15:31:31.607+0200 WARNING Binding: {
>>> http://www.opengis.net/wfs}Base_TypeNameListType does not declare a
>>> target type
>>> 2014-08-29T15:31:31.607+0200 WARNING Binding: {
>>> http://www.opengis.net/wfs}TypeNameListType does not declare a target
>>> type
>>> _____________________________________________________
>>>
>>>
>>>
>>> Would be realy thankfull, if anybody could answer my questions.
>>>
>>> With kind regards
>>> Jonas
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Slashdot TV.
>>> Video for Nerds. Stuff that matters.
>>> http://tv.slashdot.org/
>>> _______________________________________________
>>> GeoTools-GT2-Users mailing list
>>> GeoTools-GT2-Users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Slashdot TV.
>> Video for Nerds. Stuff that matters.
>> http://tv.slashdot.org/
>> _______________________________________________
>> GeoTools-GT2-Users mailing list
>> GeoTools-GT2-Users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>
>
>
>
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds. Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users