Download & Extend

Displaying geoserver filtered polygons on a WMS layer.

Project:Cartaro
Version:7.x-1.0-beta2
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hi,

I was wondering if someone can advise me on the best/correct way to display filtered polygons on an openlayers layer.

At the moment, I have the data correctly into a PostGIS database and I can display all the polygons using WMS on an OpenLayers map. What I'd like to do next is to display only a select number of polygons (identified by NID) on a WMS layer.

Looking at the layer preview from GeoServer, I can see that OpenLayers does provide support to pass a FeatureID to GeoServer in order to filter the rendered polygon. How can I do a something equivalent using Cartaro and is this the best way to proceed (as opposed to filtering via SLD for example).

Any advice will be appreciated.

Kind Regards
Ben

Comments

#1

Status:active» needs review

Hi Ben,

right now Cartaro doesn't provide a user interface to pass filter parameters to a WMS layer. There're multiple solutions, for example you can modify the OpenLayers map and the WMS layer using JavaScript in a custom Drupal theme.

A cleaner approach would require you to write a custom OpenLayers behavior. Have a look at the cluster behavior provided by the OpenLayers module on how to modify layers.

Hope that helps and sorry for answering that late, this time of the year is always busy.

Kind Regards
Friedjoff

#2

Hi Friedjoff,
when you say "right now Cartaro doesn't provide a user interface to pass filter parameters to a WMS layer" it means it is on cartaro roadmap?
May we have an approximate schedule on when such a feature will be implemented?
Thanks

Not sure if this can help Ben, but I was able to display a subset of objects, in my case based on a taxonomy term, on an OpenLayers map modifying the SQL query produced by Geoserver and available at admin/structure/geoserver/layers/list/XXXXX/edit basically adding another WHERE clause.

#3

Hi mato,

we don't have any schedule for such a feature. But if the community provides a patch, we might implement this rather quickly.

#4

Status:needs review» closed (fixed)

Further questions may be discussed in #1917984: [META] Query support in Cartaro

nobody click here