Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forwards URL parameters in WMS cascading #4797

Closed
elzouavo opened this issue Oct 22, 2013 · 2 comments
Closed

Forwards URL parameters in WMS cascading #4797

elzouavo opened this issue Oct 22, 2013 · 2 comments
Labels

Comments

@elzouavo
Copy link

MapServer allows "Changing map file parameters via a form or a URL" (cf. http://mapserver.org/cgi/controls.html#changing-map-file-parameters-via-a-form-or-a-url).
WMS 1.3 standard specifies the pixel width : 0.28 mm. That value gives a resolution of 25.4/0.28 = 90.71 dpi approximately.
Common GIS softwares works with a resolution of 96 dpi.
Popular WMS servers extend WMS service with dpi parameters:

  • MapServer with MAP_RESOLUTION=value ;
  • GeoServer with FORMAT_OPTIONS=dpi:value ;
  • QGIS Server with DPI=value.

For example, QGIS adds all those parameters at the end of WMS/GetMap queries.

I've tested with MapServer 6.2 and it works fine, but...
When MapServer is also used as WMS client, it doesn't cascade those parameters.

At the present time for a layer named Layer1 :

  • MapServer, as WMS Server, takes into account MAP_RESOLUTION via an URL
  • If Layer1 uses MapServer as WMS client (cascade WMS), MAP_RESOLUTION (and the others dpi parameter) are lost.

Is it possible to improve MapServer to forward those 3 parameters in WMS cascades.

Regards

@jratike80
Copy link

Hi,

I think that you can do that already if you know the brand of the remote WMS because the extra parameters can be included in the server ur and runtime substitution can be used in CONNECTION http://mapserver.org/cgi/runsub.html. Therefore it migh be possible to use
CONNECTION "http://demo.mapserver.org/cgi-bin/wms?vendor_parameter1=%MAP_RESOLUTION%"

However, I am not sure if it really works because MAP_RESOLUTION is a known keyword for Mapserver and I do not know if is can be used as a variable. You may have a try. But for sure you can use a hardcoded resolution parameter in the server URL if it is not so important for you to let user to adjust the resolution on the fly.

@elzouavo
Copy link
Author

elzouavo commented Nov 4, 2013

Hi,

Thank you for your reply. I tried the proposed solution. MapServer is being used as a client and server WMS. I added &MAP_RESOLUTION =%MAP_RESOLUTION% to the layer CONNECTION but it does not work.
I've read the documentation and I saw FILTER VALIDATION.
So I've had "MAP_RESOLUTION" "^[0-9]{1,3}$" to the VALIDATION block into the WEB block and "all's well that ends well !".
It works !!!!!!!

Thanks a lot
Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants