I ran into this recently as well actually. And this behavior has 
somewhat changed recently in its implementation. That said from my 
knowledge of the wfs and filter specs when a geometry property name is 
omitted form a filter it means match it against all geometries of the 
feature.

Now our implementation takes the empty string and matches that to the 
first geometry it finds. But that only occurs if you go through a 
property accessors. Calling feature.getDefaultGeometry() used to apply 
the same convention, but it was moved out and into the property accessors.

So in terms of GeoServer and WFS, I actually think this is place where 
we are not quite doing it right, but the cite tests don't really 
exercise this case very well so just by returning the first non null 
geometry attribute when no geometry name is specified in a filter we 
make it work.

So I agree with Andrea, the filter should technically be run against all 
geometry fields when one is specified.

-Justin

Andrea Aime wrote:
> [email protected] ha scritto:
>> Hi list,
>>  
>> Can you have more than 1 geometry attribute in a feature?
> 
> Yes, the current SimpleFeature supports N, either 0, 1 or many.
> 
>> I'm just wondering, because I'm trying to fix bounding box query for 
>> complex features.
>> It works with my fix, but only if you don't specify the geometry 
>> attribute name (so it will use the default geometry, ie. the first (and 
>> only?) geometry attribute).
>> eg. 
>> wfs?request=GetFeature&typeName=gsml:MappedFeature&bbox=132,-27,133,-26 
>> <http://localhost:8080/geoserver/wfs?request=GetFeature&typeName=gsml:BoreholeDetails&bbox=132,-27,133,-26>
>>  works
>>  
>> But if I specify the geometry attribute name in the filter, it doesn't 
>> work.
>> eg. 
>> wfs?request=GetFeature&typeName=gsml:MappedFeature&propertyName=gsml:shape&bbox=132,-27,133,-26
>>  
>> <http://localhost:8080/geoserver/wfs?request=GetFeature&typeName=gsml:BoreholeDetails&bbox=132,-27,133,-26>
>>  
>> I know where to fix it, I'm just not sure if I should (ie. if this 
>> scenario should be supported, or ever needed).
> 
> Hmmm... I think the answer should contain the full bbox including all
> geometries in the returned attributes, not just the default one.
> But then again, not sure we ever specified that anywhere in the API
> Curious to hear what others think about the subject
> 
> Cheers
> Andrea
> 

-- 
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to