[mapserver-users] Filter by date

Lime, Steve D (MNIT) Steve.Lime at state.mn.us
Mon Apr 15 07:53:54 PDT 2013


Hmmmm... The MapServer mapfile parser will probably choke on /'s. You have a couple of options:

Use a wildcard (tweak as necessary):

FILTERITEM "year"
FILTER /^[0-9]{1,2}.[0-9]{1,2}.[0-9]{4}$/

Use a logical expression (assumes version 6.x):

FILTER ("[year]" ~ "^[0-9]{1,2}/[0-9]{1,2}/[0-9]{4}$")

Steve

From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Weisbender, Eric
Sent: Friday, April 12, 2013 11:36 AM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] Filter by date

Hello List

How would I FILTER a data set by the month and year ignoring the day.  An example of the field format is 1/11/2010.  I found the example below in the docs but I'm not quite sure how to format the filter to account for the slashes.  Any help is greatly appreciated.

FILTERITEM "year"
FILTER /^20[0-9][0-9]/


Thanks,
Eric

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20130415/11ae909d/attachment.html>


More information about the mapserver-users mailing list