Search code examples
leafletcqlgeoserverwms

WMS filter by Date


I have a WMS layer getting served from Geoserver. The layer exposes a date property that is stored in the database as a Date type. I would like to filter the layer by date range. For example: cql_filter=date>2015-07-01T00:00:00.000Z.

I am having a difficult time getting this to work and an unable to find any working examples.

Does any one have a working CQL date range example? Or Filter date range examples?

Thanks,

Nathan


Solution

  • This link has some examples.

    Intro to CQL

    One thing that I have run into with CQL is the case sensitivity and field naming. In your example you reference date as a field. Maybe date is a reserved word? Try bumping up your logging in geoserver and check for errors or see what SQL gets generated. Double check the field name in the layer definition.