By David Crowther
Question:
Does MapThat allow you to apply CQL Filters to WMS Layers Table?
Answer:
Yes, MapThat can render any OGC compliant WMS layer, including external and internal WMS layers that you may create via GeoServer.
For your own internal WMS layers, you simply need to reference the GeoServer Server URL and the GeoServer Layer Name when creating the MapThat WMS URL. In this example , we have a CRIME WMS layer called lcc_crimes_2018_12_all within our GeoServer instance.
For this example, this would be the MapThat compatible URL -
And when shown in MapThat the WMS renders to show all the different types of crimes -
If you wish to then have separate MapThat WMS Layers for each crime type, you could create individual WMS layers within GeoServer, for example, here is the Burglary WMS layer in GeoServer -
Where in GeoServer you would add a CQL filter in the Layer Data Properties to create the Burglary WMS from the FULL CRIME Table -
You would then reference this individual GeoServer Burglary WMS in your MapThat layer -
And the Burglary layer would show in MapThat -
However, this would mean you would need to create ALL the INDIVIDUAL WMS layers in GeoServer first, which can be time consuming –
Instead, you can simply create one GeoServer Crime WMS Layer –
And then in the separate MapThat WMS Layers, you can apply the filter on the fly per MapThat Layer. For example, below is the WMS URL needed for the Burglary MapThat layer -
The URL is the same as the FULL CRIME layer, but in MapThat we have added the &CQL_FILTER… applying the filter where type=’Burglary’
Once applied to your MapThat layer, the layer will reference the FULL CRIME WMS, but will filter on the fly to only show the crimes where their type = ’Burglary’
So, using the CQL FILTER on the end of the MapThat WMS URLS allows you to create multiple MapThat layers using one single GeoServer WMS!
Comments
0 comments
Please sign in to leave a comment.