[mapserver-users] Filter by date

Weisbender, Eric Weisbend at WAPA.GOV
Mon Apr 15 07:55:31 PDT 2013


Awesome, thanks so much.

Thanks,

Eric Weisbender

From: Lime, Steve D (MNIT) [mailto:Steve.Lime at state.mn.us]
Sent: April 15, 2013 8:54 AM
To: Weisbender, Eric; mapserver-users at lists.osgeo.org
Subject: RE: Filter by date

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> [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<mailto: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/62055a61/attachment.html>


More information about the mapserver-users mailing list