[MapServer-users] is it possible to use other attributes stored on tileindex and querry dataset using them?

Rahkonen Jukka jukka.rahkonen at maanmittauslaitos.fi
Fri May 26 02:52:09 PDT 2023


Hi,


  *   is there possibility to add new parameter to url request based on another attribute in vector index file, for example max_cloud_cover or polarization_type?

Simple. Add query parameters into the DATA of the tileindex layer.

So instead of
DATA "tile-index"
use
DATA "select * from tile-index where max_cloud_cover<%maxcc% and  polarization_type='%polcode%'"

Read https://mapserver.org/cgi/runsub.html about validation and defaults. And finally for filtering create GetMap requests so that they include &maxcc=80&polcode=A

Utilizing the extra parameters with standard clients like QGIS can make some headache especially if it should be possible to change them dynamically. Half-dynamic method it to include the extra parameters into the WMS connection string and configure QGIS to “Ignore GetMap URI reported in capabilities”. With some other clients it is possible to configure vendor parameters which are then appended into GetMap. And I have seen that some clever servers are configured to manipulate the GetCapabities answer so that extra parameters (access_token etc) which are used in GetCapabilities request are added into the GetMap link in the response.

-Jukka Rahkonen-





Lähettäjä: MapServer-users <mapserver-users-bounces at lists.osgeo.org> Puolesta Marcin Niemyjski via MapServer-users
Lähetetty: perjantai 26. toukokuuta 2023 12.22
Vastaanottaja: Marcin Niemyjski via MapServer-users <mapserver-users at lists.osgeo.org>
Aihe: Re: [MapServer-users] is it possible to use other attributes stored on tileindex and querry dataset using them?


Jukka,

you were right! Now it works like a charm! Big thank you! And Thanks Tanya for a suggestion.

But in reference to my first mail - is there possibility to add new parameter to url request based on another attribute in vector index file, for example max_cloud_cover or polarization_type? :D

Best,
Marcin
Marcin Niemyjski
Junior Data Scientist
CloudFerro sp z o.o.
office: Fabryczna 5          m: +48 695 831 753
00-446 Warszawa, Poland    e: mniemyjski at cloudferro.com<mailto:mniemyjski at cloudferro.com>
[https://i.imgur.com/jlLouj5.png]<https://cloudferro.com/>

[cid:image001.png at 01D98FCE.104C2180]<https://outlook.office.com/bookwithme/user/6347c7def05a478ba013ae948648789d@cloudferro.com?anonymous&ep=signature>
Book time to meet with me<https://outlook.office.com/bookwithme/user/6347c7def05a478ba013ae948648789d@cloudferro.com?anonymous&ep=signature>
________________________________
From: Rahkonen Jukka <jukka.rahkonen at maanmittauslaitos.fi<mailto:jukka.rahkonen at maanmittauslaitos.fi>>
Sent: Thursday, May 25, 2023 6:27 PM
To: Marcin Niemyjski <mniemyjski at cloudferro.com<mailto:mniemyjski at cloudferro.com>>; Marcin Niemyjski via MapServer-users <mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>>
Subject: Re: is it possible to use other attributes stored on tileindex and querry dataset using them?


Hi,



Read the whole documentation page. Mapserver is implementing the WMS-T standard and in the standard the time parameter is named “TIME”. See examples https://mapserver.org/ogc/wms_time.html#supported-time-requests. So even the timeitem in your tileindex is “timestamp”, the parameter to use in GetMap is &TIME=



-Jukka Rahkonen-





Lähettäjä: MapServer-users <mapserver-users-bounces at lists.osgeo.org<mailto:mapserver-users-bounces at lists.osgeo.org>> Puolesta Marcin Niemyjski via MapServer-users
Lähetetty: torstai 25. toukokuuta 2023 17.54
Vastaanottaja: Marcin Niemyjski via MapServer-users <mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>>
Aihe: [MapServer-users] is it possible to use other attributes stored on tileindex and querry dataset using them?





Hello,



I've managed to find solution similar solution to what I looked for in pervious mail at https://mapserver.org/ogc/wms_time.html#example-of-wms-t-with-postgis-tile-index-for-raster-imagery



but when using below GetMap url request, Mapserver keeps returning data for default timestamp parameter value (which is 2023-02-02) although I'm passing new value in url:



GetMap:

http://localhost/cgi-bin/mapserv?map=/var/www/mapbender/TileIndex.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=1685028.275800409261,1801821.474313705694,6595587.571330638602,9965795.399527186528&CRS=EPSG:3857&WIDTH=726&HEIGHT=1207&LAYERS=Sentinel%202%20Ukraine%20TileIndex%20GPKG&STYLES=&FORMAT=image/png&DPI=157&MAP_RESOLUTION=157&FORMAT_OPTIONS=dpi:157&TRANSPARENT=TRUE&timestamp=2023-02-05



can you please take a look at my mapfile? -> https://pastecode.io/s/oxvnycg3



Any suggestions?

Marcin

Marcin Niemyjski
Junior Data Scientist
CloudFerro sp z o.o.

office: Fabryczna 5          m: +48 695 831 753
00-446 Warszawa, Poland    e: mniemyjski at cloudferro.com<mailto:mniemyjski at cloudferro.com>

[https://i.imgur.com/jlLouj5.png]<https://cloudferro.com/>



[cid:image001.png at 01D98FCE.104C2180]<https://outlook.office.com/bookwithme/user/6347c7def05a478ba013ae948648789d@cloudferro.com?anonymous&ep=signature>

Book time to meet with me<https://outlook.office.com/bookwithme/user/6347c7def05a478ba013ae948648789d@cloudferro.com?anonymous&ep=signature>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20230526/773da4b7/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 528 bytes
Desc: image001.png
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20230526/773da4b7/attachment-0001.png>


More information about the MapServer-users mailing list