Hi

I need to pass multiple id’s on a url as a viewparams variable

I’ve set up an create SQL view to a postgis database the sql is similar to


Select distinct id,val1,val2,geom from table where id IN (%VP%)   if I hard
code this it works ie Select distinct id,val1,val2,geom from table where id
IN (1234,5678)

SQL view parameter

name VP no default validate regex = ^[\d}+$    tried ^[\d,]+$ & ^[\d\,]+]
but they wont save

  So onto the url

 

Localhost:8080/geoserver/cite/wms?service=WMS&version=1.1.0&request=GetMap&layers=cite:Layer1,
cite:Layer2&
viewparamsVPa:1,VP:1234\,5678,&styles=&bbox……..width=512,heaigt=430&srs=EPSG:4326&application/openlayers

 

VPa is a single id from another postgis table.

All I get is a blank screen the server log  says 1234,5678 doesn’t match 
^[\d}+$


If VP only has one id ie VP:1234 then it works and I get the correct result


With this type of layer what is the best practice regarding setting min &
max  bounding box? As I’ve no idea until after the query so  I’ve set these
to the absolute values then pass the values on the url? (for this example
I’ve left them on what was hard coded settings)



--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/Passing-multiple-id-s-via-a-url-to-viewparams-variable-tp4466010p4466010.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to