Hi Andrea,
I see your point. Would it be right to say that it should be OGC Feature
Specification that will dictate if a feature should have a source or not
and GeoJson should follow that spec? That is a theoretical side :)
>From a practical I have a situation when I fetch a list of features from
multiple layers and then show it to a user. User will select one, I add it
into OpenLayers Vector layer and I want also to show WMS layer under. The
way I do it now: get fid, substring to ".", match against layer names I did
the query, and use the matched one. If I have a layer with the same name in
both namespaces I'm in trouble, plus what I do is a hack. Maybe there is
another way round it?
I have a suspicion that this problem with heterogeneous features is
evolutional, i.e. before you could get features only from one layer only,
so you know where it comes from, no problems. Now we can query two or more
layers and specs say you don't have to specify a source, feature is a
feature and its independent. But as a programmer I *want *to know where it
came from.
Cheers Alex
On Thu, Jun 14, 2012 at 4:15 PM, Andrea Aime
<[email protected]>wrote:
> On Thu, Jun 14, 2012 at 4:57 AM, Alexandre Djioev <[email protected]>
> wrote:
> > Hi everyone,
> >
> > Assume I will do a getFeature query to multiple layers, something like
> this:
> >
> >
> http://localhost:8080/geoserver/topp/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=topp:tasmania_cities,topp:tasmania_roads&propertyName=(ADMIN_NAME,CITY_NAME)(TYPE)
> >
> > I get following response, and you can see that feature includes info
> about a
> > layer it came from, in this case topp:tasmania_cites:
> >
> > <gml:featureMember>
> > <topp:tasmania_cities fid="tasmania_cities.1">
> > <topp:CITY_NAME>Hobart</topp:CITY_NAME>
> > <topp:ADMIN_NAME>Tasmania</topp:ADMIN_NAME>
> > </topp:tasmania_cities>
> > </gml:featureMember>
> >
> > If I do the same for json request by adding optuputFormat=json parameter
> I
> > get:
> >
> features":[{"type":"Feature","id":"tasmania_cities.1","geometry":null,"properties":{"CITY_NAME":"Hobart","ADMIN_NAME":"Tasmania"}},
> > etc...
> >
> > There is no reference to the layer name, it is truncated, so I can't be
> sure
> > where this feature came from. Is there any way round this problem?
>
> You say it's truncated, as if it was removed on purpose or by mistake, but
> afaik
> GeoJSON simply does not have the concept of layer name, see this example
> in which the same collection contains heterogeneous features without any
> indication of a "layer" whose features are coming from:
>
> http://www.geojson.org/geojson-spec.html#examples
>
> Cheers
> Andrea
>
>
> --
> Ing. Andrea Aime
> GeoSolutions S.A.S.
> Tech lead
>
> Via Poggio alle Viti 1187
> 55054 Massarosa (LU)
> Italy
>
> phone: +39 0584 962313
> fax: +39 0584 962313
> mob: +39 339 8844549
>
> http://www.geo-solutions.it
> http://geo-solutions.blogspot.com/
> http://www.youtube.com/user/GeoSolutionsIT
> http://www.linkedin.com/in/andreaaime
> http://twitter.com/geowolf
>
--
Cheers, Alex
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users