[Geoserver-users] WMS GetFeatureInfo with "vendorParams" does not work like before after upgrade to 2.5.x

Hi,

Looks like you found an undocumented/unintended feature in Geoserver 2.3.4 which does not work anymore. For your use case the "test every attribute name from a long list against all layers and take all matches" suits perfectly. However, I fear it could also make some users unhappy if they happen to have some common attribute name for many layers (like ID, name etc.) but they would like to show those only for certain layers.

Perhaps the best solution would be like:

1) when only one name list is given as &propertyName=attr1,attr2,attr3...
-> test each attribute name for all the layers, take the matching ones and skip quietly those which do not match
2) when separate lists are given separated with brackets as &propertyName=(attr1, attr2)(attr3,attr4)
-> be strict and require that there are as many propertyName lists as query layers and that attribute names match. Or be lenient and skip the non-matching names which could be less irritation sometimes.

Now it is only upon making some developer interested in implementing the change. I bet that making GetFeatureInfos for many query layers with propertyName lists is not very common technique.

Is there something that prevents you from making SQL View layers on the server side and pick just the attributes you want to show with GetFeatureInfo into the views? Then you could forget the propertyName lists.

-Jukka Rahkonen-

sys49152 wrote:

Thanks for your suggestions on JIRA.

So, I tried corrected code below
--------------------------------------------------------------------------------------------------
---
  var info = new
OpenLayers.Control.WMSGetFeatureInfo(
    {
    url:
"http://192.168.0.38/geoserver/jkp_naissus/wms",
    title: 'Identifikuj',
    layers: [vodovod, vodomeri], // fekalna,
atmosferska, cesme
    vendorParams:
{propertyName:['(SIFRA,NAZIV,ULICA,KUCNI_BROJ)
ULICA,MATERIJAL,DN_MM,IZVOR_INFORMACIJE)']},
-------------------------------------------------------------------------------------------
and it works, BUT only If both layers are ON.

<http://osgeo-org.1560.x6.nabble.com/file/n5155914/12-8-2014_10-34-
13.jpg>

When one of those two layers are not visible (and my users quite often don't use
both layers on screen), then I got

*Mismatch between the property name set count 2 and the query layers count 1
*

<http://osgeo-org.1560.x6.nabble.com/file/n5155914/12-8-2014_10-34-
44.jpg>

I understand what this means but I now dont know how to create behaviour like
before - and that was to return only attributes which Ive put into
'propertyName' of choosen layers if they are found within a click.

Its obviously something changed in GeoServer and now I dont know how to do
the right thing.
Please could you instruct me more in detail how to do it, I am not an expert ?

Thanks for your efforts !

p.s
I have to say that documented syntax was the same last year for GeoServer
2.3.4 and my old code work without a problem. I had a problem with figuring
out how to do it proper syntax for more than one layer so I asked question here
a year ago http://osgeo-org.1560.x6.nabble.com/WMS-vendor-quot-
propertyName-quot-parameter-syntax-td5044926.html
<http://osgeo-org.1560.x6.nabble.com/WMS-vendor-quot-propertyName-
quot-parameter-syntax-td5044926.html>

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/WMS-
GetFeatureInfo-with-vendorParams-does-not-work-like-before-after-upgrade-
to-2-5-x-tp5155715p5155914.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

On Tue, Aug 12, 2014 at 11:52 AM, Rahkonen Jukka (Tike) <
jukka.rahkonen@anonymised.com> wrote:

Hi,

Looks like you found an undocumented/unintended feature in Geoserver 2.3.4
which does not work anymore.

Yes, I agree, this is a bug that got fixed in 2.5.x (one that the user in
question was using as a feature)

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------