[mapserver-users] Mapserver filter/expression by DATE

drobins d.robins at gisarts.nl
Tue Aug 9 05:54:59 PDT 2016


Hi jeff,

does this apply also if I have different projects from different
start/enddates?
Lets say I have 3 projects:
Project A: 2016-01-01 till 2019-01-01
Project B: 2017-02-02 till 2022-01-01
Project C: 2018-03-03 till 2025-05-01

When I check YR2017 I want to see Project A and B but not C

Note that I find it a little difficult to really explain what I'm trying to
achieve :)
I guess easiest description would be like being able to scroll
forward/backwards and depending on where I stop, display everything that is
active on that current selected date.

Thanks
-Daniel


jmckenna wrote
> Hello,
> 
> You can create your query through the commandline tool 'psql', and once 
> you have that working you can test through the 'ogrinfo' commandline 
> tool, using its '-sql' switch.  Then you can test through MapServer with 
> the 'shp2img' commandline tool, by setting that query within the DATA 
> statement of your mapfile layer.  See examples at 
> http://www.mapserver.org/input/vector/postgis.html
> 
> -jeff
> 
> -- 
> Jeff McKenna
> MapServer Consulting and Training Services
> http://www.gatewaygeomatics.com/
> 
> 
> 
> On 2016-08-09 8:56 AM, drobins wrote:
>> I have a PostGIS database and I have a column "startdate" and "enddate"
>> in my
>> database (YYYY-MM-DD format).
>> What I want to do is make a filter/expression that checks if a certain
>> selected date falls between those 2 dates.
>>
>> Example:
>> I have a checkbox for enable/disable the following layers:
>> 2016
>> 2017
>> 2018
>> 2019
>> 2020
>>
>> I have an entry in my database with:
>> startdate: 2016-01-01
>> enddate: 2019-01-01
>>
>> If I check the layer 2017, I would like it to check if its between the
>> start/enddate and if yes, display it.
>> Is this possible with Mapserver/Openlayers?
>>
>>
> 
> 
> _______________________________________________
> mapserver-users mailing list

> mapserver-users at .osgeo

> http://lists.osgeo.org/mailman/listinfo/mapserver-users





--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Mapserver-filter-expression-by-DATE-tp5280038p5280061.html
Sent from the Mapserver - User mailing list archive at Nabble.com.


More information about the mapserver-users mailing list