Re: [MapServer-users] wms time validation of time parameter against timeextent gives unexpected results

2023-02-12 Thread Clausen Marcel via MapServer-users
Hello Steve


Sure with the logging enabled i get the following:


mapfile metadata: "wms_timeextent" "2005/2022"

request: 
SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=ch.swisstopo.lubis-bildstreifen&CRS=EPSG:2056&STYLES=&WIDTH=860&HEIGHT=600&BBOX=242,105,285,135&TIME=2022-01-01/2022-12-31

log:

wms-bgdi_1  |  [warn] [pid 9229] mod_fcgid: stderr: msWMSApplyTime: WMS server 
error. Time value(s) 2022-01-01/2022-12-31 given is invalid or outside the time 
extent defined (2005/2022).
wms-bgdi_1  |  [warn] [pid 9229] mod_fcgid: stderr: freeLayer(): freeing layer 
at 0x557566f87510.
wms-bgdi_1  |  [warn] [pid 9229] mod_fcgid: stderr: msPostGISLayerIsOpen called.
wms-bgdi_1  | 172.26.0.1 - - [13/Feb/2023:07:23:28 +] "GET 
/local/?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=ch.swisstopo.lubis-bildstreifen&CRS=EPSG:2056&STYLES=&WIDTH=860&HEIGHT=600&BBOX=242,105,285,135&TIME=2022-01-01/2022-12-31
 HTTP/1.1" 200 674


With this time extent definition nothing is being sent to the database. The 
time value is considered as invalid (outside the time extent) by the validation 
code -> InvalidDimensionValue.
https://github.com/MapServer/MapServer/blob/f3f05d4cf30af615d5f443a1c47c20b6117e52cb/mapwms.cpp#L268

If we increase the upper bound of the time extent by one year we get the 
following logs:

mapfile metadata: "wms_timeextent" "2005/2023"

request: 
SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=ch.swisstopo.lubis-bildstreifen&CRS=EPSG:2056&STYLES=&WIDTH=860&HEIGHT=600&BBOX=242,105,285,135&TIME=2022-01-01/2022-12-31

logs:

msPostGISLayerWhichShapes query: select 
"resolution"::text,"flugdatum"::text,ST_AsBinary(("the_geom"),'NDR') as 
geom,"bildstreifen_nr"::text from (
SELECT
   the_geom
, filmart
, firma
, flugdatum
, objectid
, resolution
, bildstreifen_nr
, bildstreifen_nr as id
, bgdi_flugjahr
, area
, gsd
, toposhop_length
, toposhop_start_x
, toposhop_start_y
, toposhop_end_x
, toposhop_end_y
, toposhop_date
, goal
, georef_source as source_georef
from ads40.view_bildstreifen
WHERE
firma like 'swisstopo'
order by resolution desc
) AS bla where ST_Intersects("the_geom", ST_GeomFromText('POLYGON((2420250 
1050250,2420250 1349750,2849750 1349750,2849750 1050250,2420250 
1050250))',2056)) and (("flugdatum" >= date_trunc('day',date '2022-01-01') and 
"flugdatum" <= (date_trunc('day',date '2022-12-31') + interval '1 day' - 
interval '1 second')))
msPostGISLayerWhichShapes query status: PGRES_TUPLES_OK (2)
msPostGISLayerWhichShapes got 482 records in result.
msPostGISLayerNextShape called.
msPostGISReadShape called.

The full layer config is here: https://pastebin.com/NkJXnRJt

Thank you and best regards
Marcel



Von: Lime, Steve D (MNIT) 
Gesendet: Donnerstag, 9. Februar 2023 23:04:03
An: Clausen Marcel swisstopo
Cc: mapserver-users@lists.osgeo.org
Betreff: RE: [MapServer-users] wms time validation of time parameter against 
timeextent gives unexpected results

So, if you turn on logging, what shows up in terms of Pg queries.

-Original Message-
From: MapServer-users  On Behalf Of 
Clausen Marcel via MapServer-users
Sent: Tuesday, February 7, 2023 7:37 AM
To: sdl...@gmail.com
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [MapServer-users] wms time validation of time parameter against 
timeextent gives unexpected results

Hello Steve


Thank you for your response,
we would have expected that too.

with wms 1.1 the service response is the same.

with this metadata "wms_timeextent" "2005/2022"
the service response is:

http://localhost:/local/?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=ch.swisstopo.lubis-bildstreifen&SRS=EPSG:2056&STYLES=&WIDTH=860&HEIGHT=600&BBOX=242,105,285,135&TIME=2022-01-01/2022-12-31

 
 
msWMSApplyTime: WMS server error. Time value(s) 2022-01-01/2022-12-31 given is 
invalid or outside the time extent defined (2005/2022).



The only work-around we found so far is to set the time-range in the metadata 
with a date precision of day:
"wms_timeextent" "2005-01-01/2022-12-31" but then in the getcap we would have 
this information:

2005-01-01/2022-12-31

which is not representing the real nature of this dataset, the ti

Re: [MapServer-users] wms time validation of time parameter against timeextent gives unexpected results

2023-02-09 Thread Lime, Steve D (MNIT) via MapServer-users
So, if you turn on logging, what shows up in terms of Pg queries.

-Original Message-
From: MapServer-users  On Behalf Of 
Clausen Marcel via MapServer-users
Sent: Tuesday, February 7, 2023 7:37 AM
To: sdl...@gmail.com
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [MapServer-users] wms time validation of time parameter against 
timeextent gives unexpected results

Hello Steve


Thank you for your response,
we would have expected that too.

with wms 1.1 the service response is the same.

with this metadata "wms_timeextent" "2005/2022"
the service response is:

http://localhost:/local/?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=ch.swisstopo.lubis-bildstreifen&SRS=EPSG:2056&STYLES=&WIDTH=860&HEIGHT=600&BBOX=242,105,285,135&TIME=2022-01-01/2022-12-31

 
 
msWMSApplyTime: WMS server error. Time value(s) 2022-01-01/2022-12-31 given is 
invalid or outside the time extent defined (2005/2022).



The only work-around we found so far is to set the time-range in the metadata 
with a date precision of day:
"wms_timeextent" "2005-01-01/2022-12-31" but then in the getcap we would have 
this information:

2005-01-01/2022-12-31

which is not representing the real nature of this dataset, the time resolution 
here should be a year.

Best regards
Marcel




Von: Steve Lime 
Gesendet: Montag, 6. Februar 2023 17:48:26
An: Clausen Marcel swisstopo
Cc: mapserver-users@lists.osgeo.org
Betreff: Re: [MapServer-users] wms time validation of time parameter against 
timeextent gives unexpected results

Does WMS 1.1 behave the same? I suppose it comes down to how 2022 is 
interpreted as part of a range, I would have expected it would mean any date in 
that year. Sounds like it's behaving like strictly less than 2022-01-01. What 
happens if you set the range using full dates, so something like: 
20050101/20221231?

--Steve

On Thu, Feb 2, 2023 at 3:33 AM Clausen Marcel via MapServer-users 
mailto:mapserver-users@lists.osgeo.org>> wrote:

Dear all

We have the following question concerning the configuration and usage of time 
enabled wms layers.

We are using the following metadata section for a time-enabled layer:

METADATA
"wms_enable_request" "*"
"wms_title" "lubis_bildstreifen"
"wms_extent" "210 105 285 140"
"wms_timeextent" "2005/2022"
"wms_timeitem" "flugdatum" # this is a date column in postgres
END


The time precision/resolution of the timeextent has to be set as year.

The validation of the time parameter against the time extent with year 
precision gives some strange results. We were using the following getmap 
request for the tests:

localhost:/local/?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=ch.swisstopo.lubis-bildstreifen&CRS=EPSG:2056&STYLES=&WIDTH=860&HEIGHT=600&BBOX=242,105,285,135&TIME=2022

parameter:  time=2005
result: returns all features of 2005
expected result:ok

parameter:  time=2022
result: returns all features of 2022
expected result:ok

parameter:  time=2023
result: returns ServiceException [1]
expected result:ok

parameter:  time=2022-01-01
result: returns ServiceException [2]
expected result:we would expect this to be a valid timestamp

parameter:  time=2022-01-01/2022-12-31
result: returns ServiceException [3]
expected result:we would expect this to be a valid timestamp

It seems that if the precision of the time parameter is of -MM or 
-MM-TT the upper bound of the defined timextent 2005/2022 is not respected 
correctly.
We got the same result with the timextent defined  as: 2005/2022/P1Y

our mapserver version is:


Does someone have some insights or hints?

Best regards
Clausen Marcel

[1]
msWMSApplyTime: WMS server 
error. Time value(s) 2023 given is invalid or outside the time extent defined 
(2005/2022).

[2]
 msWMSApplyTime: WMS server 
error. Time value(s) 2022-01-01 given is invalid or outside the time extent 
defined (2005/2022). 

[3]
 msWMSApplyTime: WMS server 
error. Time value(s) 2022-01-01/2022-12-31 given is invalid or outside the time 
extent defined (2005/2022). 









___
MapServer-users mailing list
MapServer-users@lists.osgeo.org<mailto:MapServer-users@lists.osgeo.org>
https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fmapserver-users&data=05%7C01%7Csteve.lime%40state.mn.us%7C20a25ea5e6e1488c95a7

Re: [MapServer-users] wms time validation of time parameter against timeextent gives unexpected results

2023-02-07 Thread Clausen Marcel via MapServer-users
Hello Steve


Thank you for your response,
we would have expected that too.

with wms 1.1 the service response is the same.

with this metadata "wms_timeextent" "2005/2022"
the service response is:

http://localhost:/local/?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=ch.swisstopo.lubis-bildstreifen&SRS=EPSG:2056&STYLES=&WIDTH=860&HEIGHT=600&BBOX=242,105,285,135&TIME=2022-01-01/2022-12-31


http://schemas.opengis.net/wms/1.1.0/exception_1_1_0.dtd";>


msWMSApplyTime: WMS server error. Time value(s) 2022-01-01/2022-12-31 given is 
invalid or outside the time extent defined (2005/2022).



The only work-around we found so far is to set the time-range in the metadata 
with a date precision of day:
"wms_timeextent" "2005-01-01/2022-12-31" but then in the getcap we would have 
this information:

2005-01-01/2022-12-31

which is not representing the real nature of this dataset, the time resolution 
here should be a year.

Best regards
Marcel




Von: Steve Lime 
Gesendet: Montag, 6. Februar 2023 17:48:26
An: Clausen Marcel swisstopo
Cc: mapserver-users@lists.osgeo.org
Betreff: Re: [MapServer-users] wms time validation of time parameter against 
timeextent gives unexpected results

Does WMS 1.1 behave the same? I suppose it comes down to how 2022 is 
interpreted as part of a range, I would have expected it would mean any date in 
that year. Sounds like it's behaving like strictly less than 2022-01-01. What 
happens if you set the range using full dates, so something like: 
20050101/20221231?

--Steve

On Thu, Feb 2, 2023 at 3:33 AM Clausen Marcel via MapServer-users 
mailto:mapserver-users@lists.osgeo.org>> wrote:

Dear all

We have the following question concerning the configuration and usage of time 
enabled wms layers.

We are using the following metadata section for a time-enabled layer:

METADATA
"wms_enable_request" "*"
"wms_title" "lubis_bildstreifen"
"wms_extent" "210 105 285 140"
"wms_timeextent" "2005/2022"
"wms_timeitem" "flugdatum" # this is a date column in postgres
END


The time precision/resolution of the timeextent has to be set as year.

The validation of the time parameter against the time extent with year 
precision gives some strange results. We were using the following getmap 
request for the tests:

localhost:/local/?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=ch.swisstopo.lubis-bildstreifen&CRS=EPSG:2056&STYLES=&WIDTH=860&HEIGHT=600&BBOX=242,105,285,135&TIME=2022

parameter:  time=2005
result: returns all features of 2005
expected result:ok

parameter:  time=2022
result: returns all features of 2022
expected result:ok

parameter:  time=2023
result: returns ServiceException [1]
expected result:ok

parameter:  time=2022-01-01
result: returns ServiceException [2]
expected result:we would expect this to be a valid timestamp

parameter:  time=2022-01-01/2022-12-31
result: returns ServiceException [3]
expected result:we would expect this to be a valid timestamp

It seems that if the precision of the time parameter is of -MM or 
-MM-TT the upper bound of the defined timextent 2005/2022 is not respected 
correctly.
We got the same result with the timextent defined  as: 2005/2022/P1Y

our mapserver version is:


Does someone have some insights or hints?

Best regards
Clausen Marcel

[1]
msWMSApplyTime: WMS server 
error. Time value(s) 2023 given is invalid or outside the time extent defined 
(2005/2022).

[2]
 msWMSApplyTime: WMS server 
error. Time value(s) 2022-01-01 given is invalid or outside the time extent 
defined (2005/2022). 

[3]
 msWMSApplyTime: WMS server 
error. Time value(s) 2022-01-01/2022-12-31 given is invalid or outside the time 
extent defined (2005/2022). 









___
MapServer-users mailing list
MapServer-users@lists.osgeo.org<mailto:MapServer-users@lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] wms time validation of time parameter against timeextent gives unexpected results

2023-02-06 Thread Steve Lime
Does WMS 1.1 behave the same? I suppose it comes down to how 2022 is
interpreted as part of a range, I would have expected it would mean any
date in that year. Sounds like it's behaving like strictly less than
2022-01-01. What happens if you set the range using full dates, so
something like: 20050101/20221231?

--Steve

On Thu, Feb 2, 2023 at 3:33 AM Clausen Marcel via MapServer-users <
mapserver-users@lists.osgeo.org> wrote:

>
> Dear all
>
> We have the following question concerning the configuration and usage of
> time enabled wms layers.
>
> We are using the following metadata section for a time-enabled layer:
>
> METADATA
> "wms_enable_request" "*"
> "wms_title" "lubis_bildstreifen"
> "wms_extent" "210 105 285 140"
> "wms_timeextent" "2005/2022"
> "wms_timeitem" "flugdatum" # this is a date column in postgres
> END
>
>
> The time precision/resolution of the timeextent has to be set as year.
>
> The validation of the time parameter against the time extent with year
> precision gives some strange results. We were using the following getmap
> request for the tests:
>
>
> localhost:/local/?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=ch.swisstopo.lubis-bildstreifen&CRS=EPSG:2056&STYLES=&WIDTH=860&HEIGHT=600&BBOX=242,105,285,135&TIME=2022
>
> parameter:  time=2005
> result: returns all features of 2005
> expected result:ok
>
> parameter:  time=2022
> result: returns all features of 2022
> expected result:ok
>
> parameter:  time=2023
> result: returns ServiceException [1]
> expected result:ok
>
> parameter:  time=2022-01-01
> result: returns ServiceException [2]
> expected result:we would expect this to be a valid timestamp
>
> parameter:  time=2022-01-01/2022-12-31
> result: returns ServiceException [3]
> expected result:we would expect this to be a valid timestamp
>
> It seems that if the precision of the time parameter is of -MM or
> -MM-TT the upper bound of the defined timextent 2005/2022 is not
> respected correctly.
> We got the same result with the timextent defined  as: 2005/2022/P1Y
>
> our mapserver version is:
> 
>
> Does someone have some insights or hints?
>
> Best regards
> Clausen Marcel
>
> [1]
> msWMSApplyTime: WMS server
> error. Time value(s) 2023 given is invalid or outside the time extent
> defined (2005/2022).
>
> [2]
>  msWMSApplyTime: WMS server
> error. Time value(s) 2022-01-01 given is invalid or outside the time extent
> defined (2005/2022). 
>
> [3]
>  msWMSApplyTime: WMS server
> error. Time value(s) 2022-01-01/2022-12-31 given is invalid or outside the
> time extent defined (2005/2022). 
>
>
>
>
>
>
>
>
>
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


[MapServer-users] wms time validation of time parameter against timeextent gives unexpected results

2023-02-02 Thread Clausen Marcel via MapServer-users


Dear all

We have the following question concerning the configuration and usage of time 
enabled wms layers.

We are using the following metadata section for a time-enabled layer:

    METADATA
        "wms_enable_request" "*"
        "wms_title" "lubis_bildstreifen"
        "wms_extent" "210 105 285 140"
        "wms_timeextent" "2005/2022"
        "wms_timeitem" "flugdatum" # this is a date column in postgres
    END


The time precision/resolution of the timeextent has to be set as year.

The validation of the time parameter against the time extent with year 
precision gives some strange results. We were using the following getmap 
request for the tests:  

localhost:/local/?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=ch.swisstopo.lubis-bildstreifen&CRS=EPSG:2056&STYLES=&WIDTH=860&HEIGHT=600&BBOX=242,105,285,135&TIME=2022

parameter:  time=2005
result: returns all features of 2005
expected result:ok

parameter:  time=2022
result: returns all features of 2022
expected result:ok

parameter:  time=2023
result: returns ServiceException [1]
expected result:ok

parameter:  time=2022-01-01
result: returns ServiceException [2]
expected result:we would expect this to be a valid timestamp

parameter:  time=2022-01-01/2022-12-31
result: returns ServiceException [3]
expected result:we would expect this to be a valid timestamp

It seems that if the precision of the time parameter is of -MM or 
-MM-TT the upper bound of the defined timextent 2005/2022 is not respected 
correctly.
We got the same result with the timextent defined  as: 2005/2022/P1Y

our mapserver version is:


Does someone have some insights or hints?

Best regards 
Clausen Marcel

[1]
msWMSApplyTime: WMS server 
error. Time value(s) 2023 given is invalid or outside the time extent defined 
(2005/2022).

[2]
 msWMSApplyTime: WMS server 
error. Time value(s) 2022-01-01 given is invalid or outside the time extent 
defined (2005/2022). 

[3]
 msWMSApplyTime: WMS server 
error. Time value(s) 2022-01-01/2022-12-31 given is invalid or outside the time 
extent defined (2005/2022). 








  
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users