Assistance Needed with Filtering WMS Layers on

Skip to first unread message

farkadi oussama

Jun 8, 2023, 5:23:02 PM6/8/23
to GeoAdminCh API


I am currently working on a project that involves filtering specific points from a WMS layer on the However, I have encountered some difficulties in achieving the desired outcome. I would greatly appreciate your assistance in resolving this matter.

To provide you with more context, I have been using the following URL to access the WMS service:,5995109.002462944,955462.8535647034,5995261.876519515

The specific layer I am working with is called "ch.bafu.klima-co2_ausstoss_gebaeude."

I have attempted to apply a filter query using the CQL_FILTER attribute on the "featureId" in order to retrieve a single point. However, every time I execute this query, the entire set of points is returned instead of just the desired one.

Here is an example of the code I have been using:

var roofLayer = L.tileLayer.wms("", {
  layers: 'ch.bafu.klima-co2_ausstoss_gebaeude',
  transparent: true,
  format: 'image/png',
  CQL_FILTER: "featureId==210195509_0",

Could you kindly review the provided dtails and implementation and let me know if this is the appropriate approach for applying a filter on the layer. If not, I would greatly appreciate your guidance on the correct method to accomplish this task.

Thank you very much for your time and assistance. I look forward to your response.

Best regards,

GeoAdminCh API

Jun 9, 2023, 3:28:29 AM6/9/23
to GeoAdminCh API
Hello Oussama,

We are serving WMS  using Mapserver, and from what I know the  CQL_FILTER parameter is a proprietary command of Geoserver. Mapserver has an WMS_FILTER parameter.



Reply all
Reply to author
0 new messages