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

Hi,

I made some tests with Geoserver versions 2.5.2 and 2.6 and for me the propertyName parameter does work for several query layers if I use the documented syntax http://docs.geoserver.org/stable/en/user/services/wms/vendor.html

"For multiple layers the syntax is:
propertyName=(nameLayer11,...,nameLayer1N)...(name1LayerN,...,nameNLayerN)"

Thus, give a separate propertyName list for each QUERY_LAYER. However, I noticed that Andrea already did some fix. I hope he will think again if the current behaviour has been implemented for reason and if the fix was fixing something that was not broken.

My comment on issue https://jira.codehaus.org/browse/GEOS-6604 includes test URLs which use our standard demo layers.

-Jukka Rahkonen-

-----Alkuperäinen viesti-----
Lähettäjä: sys49152 [mailto:mr_bungle@anonymised.com]
Lähetetty: 11. elokuuta 2014 0:43
Vastaanottaja: geoserver-users@lists.sourceforge.net
Aihe: [Geoserver-users] WMS GetFeatureInfo with "vendorParams" does not
work like before after upgrade to 2.5.x

Last week I've upgraded to GeoServer 2.5.2 from 2.3.4 and now the same
GetFeatureInfo request in my web site returns different results.

I am using "vendorParams" to filter layers and their attributes because I dont
want to show all fields of a table in a popup when they made a query.

Code:

With GeoServer 2.3.4 if I run a WMS getFeatureInfo request using code above it
works like it should - it shows only desired attributes which are mentioned in
"vendorParams" and only from 2 layers i have stated in "layers".

But after upgrade to 2.5.2 it looks like that you cannot put attributes from more
than 1 layer because it returns

*"Internal error occurred PropertyDescriptor is null - did you request a property
that does not exist?"*

<http://osgeo-
org.1560.x6.nabble.com/file/n5155715/pitanje_za_geoserver_i_openlayers.jpg
>

If I leave only one layer in "layers" and its attributes in "vendorParams"
it works, but if you put more than one then throws an error.

Is this a bug or ...??

Thanks.

--
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-tp5155715.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 Mon, Aug 11, 2014 at 12:47 PM, Rahkonen Jukka (Tike) <
jukka.rahkonen@anonymised.com> wrote:

Hi,

I made some tests with Geoserver versions 2.5.2 and 2.6 and for me the
propertyName parameter does work for several query layers if I use the
documented syntax
http://docs.geoserver.org/stable/en/user/services/wms/vendor.html

"For multiple layers the syntax is:
propertyName=(nameLayer11,...,nameLayer1N)...(name1LayerN,...,nameNLayerN)"

Thus, give a separate propertyName list for each QUERY_LAYER. However, I
noticed that Andrea already did some fix. I hope he will think again if the
current behaviour has been implemented for reason and if the fix was fixing
something that was not broken.

Hi,
I made a fix for propertyName being ignored, did not check the multiple
layer case, and won't be able to
this week, I'm leaving for vacation in the afternoon

If you find another issue, could you open a different ticket?

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

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

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&quot;,
    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&gt;

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&gt;

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&gt;

--
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.