Can you have more than one geometry attributes per feature?

9 messages Options
Embed this post
Permalink
Rini Angreani

Can you have more than one geometry attributes per feature?

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
Hi list,
 
Can you have more than 1 geometry attribute in a feature?
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).
 
But if I specify the geometry attribute name in the filter, it doesn't work.
 
I know where to fix it, I'm just not sure if I should (ie. if this scenario should be supported, or ever needed).
 
Thank's
 
Rini

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
aaime

Re: Can you have more than one geometry attributes per feature?

Reply Threaded More More options
Print post
Permalink
[hidden email] 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

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Milton Jonathan

Re: Can you have more than one geometry attributes per feature?

Reply Threaded More More options
Print post
Permalink
Hello folks

Humbly stepping in: I believe that if there is support for multiple
geometries (and thankfully there is!), then all such geometries should
be considered for every operation when the user has not specified anything.

In fact, I have noticed that this is indeed the behavior implemented in
SimpleFeatureImpl.getBounds(): it checks all geometries to compute the
feature's bounds.

On the other hand, this is NOT the way things are implemented in
MemoryDataStore.getBounds(): it could have just asked for each Feature's
bounds, but for some reason it computes the bounds explicitly using only
the default geometry. In my current view of things, this would be
considered a bug..

Other than that, I don't really know how things behave for other
DataStores - if my current view is correct, I hope that they all
consider all of the geometry attributes :). Taking a quick look at
JDBCDataStore, it seems to be the case.

Cheers
Milton

Andrea Aime wrote:

> [hidden email] 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
>

--

Milton Jonathan
Grupo GIS e Meio Ambiente
Tecgraf/PUC-Rio
Tel: +55-21-3527-2502

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Justin Deoliveira

Re: Can you have more than one geometry attributes per feature?

Reply Threaded More More options
Print post
Permalink
In reply to this post by aaime
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:

> [hidden email] 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
aaime

Re: Can you have more than one geometry attributes per feature?

Reply Threaded More More options
Print post
Permalink
Justin Deoliveira ha scritto:
  > So I agree with Andrea, the filter should technically be run against
all
> geometry fields when one is specified.

s/when one/when none/

Or not?

Cheers
Andrea



--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Justin Deoliveira

Re: Can you have more than one geometry attributes per feature?

Reply Threaded More More options
Print post
Permalink

Andrea Aime wrote:
> Justin Deoliveira ha scritto:
>  > So I agree with Andrea, the filter should technically be run against all
>> geometry fields when one is specified.
>
> s/when one/when none/
>
> Or not?

Ha, oops. Thanks for correcting. One character really can make all the
difference :)
>
> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
mbedward

Re: Can you have more than one geometry attributes per feature?

Reply Threaded More More options
Print post
Permalink
In reply to this post by aaime
2009/11/10 Andrea Aime:
>
> s/when one/when none/
>

A fine example of geek grammar there :)

Michael

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Rini Angreani

Re: Can you have more than one geometry attributes per feature?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Justin Deoliveira
Thank's for clearing that up, guys. Hmm the problem is bigger than I thought.  

Rini

-----Original Message-----
From: Justin Deoliveira [mailto:[hidden email]]
Sent: Monday, 9 November 2009 11:07 PM
To: Andrea Aime
Cc: Angreani, Rini (E&M, Kensington); [hidden email]
Subject: Re: [Geotools-devel] Can you have more than one geometry attributes per feature?


Andrea Aime wrote:
> Justin Deoliveira ha scritto:
>  > So I agree with Andrea, the filter should technically be run against all
>> geometry fields when one is specified.
>
> s/when one/when none/
>
> Or not?

Ha, oops. Thanks for correcting. One character really can make all the
difference :)
>
> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
aaime

Re: Can you have more than one geometry attributes per feature?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Milton Jonathan
Milton Jonathan ha scritto:

> Hello folks
>
> Humbly stepping in: I believe that if there is support for multiple
> geometries (and thankfully there is!), then all such geometries should
> be considered for every operation when the user has not specified anything.
>
> In fact, I have noticed that this is indeed the behavior implemented in
> SimpleFeatureImpl.getBounds(): it checks all geometries to compute the
> feature's bounds.
>
> On the other hand, this is NOT the way things are implemented in
> MemoryDataStore.getBounds(): it could have just asked for each Feature's
> bounds, but for some reason it computes the bounds explicitly using only
> the default geometry. In my current view of things, this would be
> considered a bug..

It looks like one to me as well. If you want to open a bug report.. (and
maybe also attach a patch to solve it? ;-)

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel