Select the dataset at runtime

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Select the dataset at runtime

Andrea Peri
Hi,

Is possible to change at runtime the datasource of a layer using a parameter of the request to choose the dataset ?

I'm explain better.
I have two datasource of the same physical phenomenon.
The first is at 96dpi and the second at 300dpi.

I like to show the first when the user see it on a webgis and ask it using a request getmap with the extra parameter map_resolution=96
Instead the mapserver should return the second dataset when the request has an extra_parameter map_resolution=300 tipically when the user call it for a print at high resolution.

I'm trying to avoid to set two distinct mapserver layers.
To avoid the user should change the layer in the request.

The solution I'm searching is to allow the use of the parameter "map_resolution" to choose the dataset to use.



--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------

_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Select the dataset at runtime

Kralidis,Tom [Ontario]
Andrea: you can do something like use runtime substitution (neat example at http://linfiniti.com/2011/09/making-the-most-of-umn-mapserver-runtime-variable-substitution/), or MapScript WxS wrappers (http://mapserver.org/ogc/mapscript.html#python-examples).



From: [hidden email] [mailto:[hidden email]] On Behalf Of Andrea Peri
Sent: June 18, 2013 2:27 PM
To: [hidden email]
Subject: [mapserver-users] Select the dataset at runtime

Hi,
Is possible to change at runtime the datasource of a layer using a parameter of the request to choose the dataset ?
I'm explain better.
I have two datasource of the same physical phenomenon.
The first is at 96dpi and the second at 300dpi.

I like to show the first when the user see it on a webgis and ask it using a request getmap with the extra parameter map_resolution=96
Instead the mapserver should return the second dataset when the request has an extra_parameter map_resolution=300 tipically when the user call it for a print at high resolution.
I'm trying to avoid to set two distinct mapserver layers.
To avoid the user should change the layer in the request.

The solution I'm searching is to allow the use of the parameter "map_resolution" to choose the dataset to use.


--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------
_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Select the dataset at runtime

Andrea Peri
Hi,
thx for response.
I see the example. Its pretty interesting.
Also another option I found in the documentation:
http://mapserver.org/cgi/runsub.html

I see in the MS6.2 should be possible to act on
DATA and DATAPATTERN.

I guess this could be a good choice, but no  other information on this and how to use.
Is this runtime substitution for DATA and DATAPATTERN really available ?

Thx,



2013/6/18 Kralidis,Tom [Ontario] <[hidden email]>
Andrea: you can do something like use runtime substitution (neat example at http://linfiniti.com/2011/09/making-the-most-of-umn-mapserver-runtime-variable-substitution/), or MapScript WxS wrappers (http://mapserver.org/ogc/mapscript.html#python-examples).



From: [hidden email] [mailto:[hidden email]] On Behalf Of Andrea Peri
Sent: June 18, 2013 2:27 PM
To: [hidden email]
Subject: [mapserver-users] Select the dataset at runtime

Hi,
Is possible to change at runtime the datasource of a layer using a parameter of the request to choose the dataset ?
I'm explain better.
I have two datasource of the same physical phenomenon.
The first is at 96dpi and the second at 300dpi.

I like to show the first when the user see it on a webgis and ask it using a request getmap with the extra parameter map_resolution=96
Instead the mapserver should return the second dataset when the request has an extra_parameter map_resolution=300 tipically when the user call it for a print at high resolution.
I'm trying to avoid to set two distinct mapserver layers.
To avoid the user should change the layer in the request.

The solution I'm searching is to allow the use of the parameter "map_resolution" to choose the dataset to use.


--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------



--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------

_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Select the dataset at runtime

Rahkonen Jukka (Tike)
Hi,

Try this live example. The sql parameter is feeding a subquery into DATA and the next link selects OpenStreetMap primary highways which do not have maxpeed tag. Change primary into secondary and you will see a different map.


http://hip.latuviitta.org/cgi-bin/ms_ows?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&WIDTH=563&HEIGHT=437&LAYERS=sea,borders,osm_viivat&TRANSPARENT=TRUE&FORMAT=image/png&BBOX=-369151.98300283286,6597900.0,1511076.628895184,8057331.444759207&SRS=EPSG:3067&STYLES=&sql=(tags @> 'highway=>primary') AND not (tags ? 'maxspeed') <http://hip.latuviitta.org/cgi-bin/ms_ows?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&WIDTH=563&HEIGHT=437&LAYERS=sea,borders,osm_viivat&TRANSPARENT=TRUE&FORMAT=image/png&BBOX=-369151.98300283286,6597900.0,1511076.628895184,8057331.444759207&SRS=EPSG:3067&STYLES=&sql=%28tags%20@%3E%20%27highway=%3Eprimary%27%29%20AND%20not%20%28tags%20?%20%27maxspeed%27%29%20>

-Jukka Rahkonen-



________________________________
Andrea Peri wrote:

Hi,
thx for response.
I see the example. Its pretty interesting.
Also another option I found in the documentation:
http://mapserver.org/cgi/runsub.html

I see in the MS6.2 should be possible to act on
DATA and DATAPATTERN.

I guess this could be a good choice, but no  other information on this and how to use.
Is this runtime substitution for DATA and DATAPATTERN really available ?

Thx,



2013/6/18 Kralidis,Tom [Ontario] <[hidden email]<mailto:[hidden email]>>
Andrea: you can do something like use runtime substitution (neat example at http://linfiniti.com/2011/09/making-the-most-of-umn-mapserver-runtime-variable-substitution/), or MapScript WxS wrappers (http://mapserver.org/ogc/mapscript.html#python-examples).



From: [hidden email]<mailto:[hidden email]> [mailto:[hidden email]<mailto:[hidden email]>] On Behalf Of Andrea Peri
Sent: June 18, 2013 2:27 PM
To: [hidden email]<mailto:[hidden email]>
Subject: [mapserver-users] Select the dataset at runtime

Hi,
Is possible to change at runtime the datasource of a layer using a parameter of the request to choose the dataset ?
I'm explain better.
I have two datasource of the same physical phenomenon.
The first is at 96dpi and the second at 300dpi.

I like to show the first when the user see it on a webgis and ask it using a request getmap with the extra parameter map_resolution=96
Instead the mapserver should return the second dataset when the request has an extra_parameter map_resolution=300 tipically when the user call it for a print at high resolution.
I'm trying to avoid to set two distinct mapserver layers.
To avoid the user should change the layer in the request.

The solution I'm searching is to allow the use of the parameter "map_resolution" to choose the dataset to use.


--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------



--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------
_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users