Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

So I have been reading up on http://mapserver.org/cgi/wrapper.html and was wondering if there are any more substantial examples of creating a full-fledge web application (using python and, if appropriate a python web framework) to handle incoming GET and POST requests for a dedicated "mapserver.mydomain.com" WMS application.

Does such an approach make sense or will the "simple shell script" given in the example in http://mapserver.org/cgi/wrapper.html suffice? Though frankly, I am not sure how the shell script is going to interface with the httpd server to handle GET/POST requests.

In particular, it may make sense to implement something like a python tilecache for the mapserver instance so the shell script might not be sufficient?

share|improve this question

1 Answer 1

up vote 4 down vote accepted


For the WMS service itself MapServer already handles the GET and POST requests for the various requests (GetCapabilities, GetMap, etc). The wrapper script is basically to predefine a few things like the location of the map file that you might not want to normally expose to the end user.

There are situations in which you might want to customize your map definition based on additional parameters passed to your service or otherwise do special stuff for some kinds of WMS requests. To support some of these use cases I implemented the so called "WxS mapscript wrapper" mechanism. This makes it possible to write a python wrapper that customizes WMS, WFS, and other services to some degree or even radically transorms incoming request into something like a WMS request with interactions with the map object. This is documented at:


Implementing a Python tilecache this way would also be possible, perhaps it the python script looking in some sort of DB or filesystem cache to see if there is already an pre-rendered answer for the request and if so using it otherwise passing things on to mapserver. But before going to a lot of effort to implement a tile cache make sure one of the pre-existing tilecache implementations isn't going to meet your needs. For instance the tile cache project that is now part of the MapServer project. I'd like to provide a pointer to it but I can't immediately find it on the mapserver.org web site.

Best regards, Frank

share|improve this answer
+1. MapCache link mapserver.org/trunk/mapcache/index.html –  geographika Jan 26 '12 at 11:23
thanks for the comprehensive answer and link to the trunk docs. Somehow, I couldn't find my way to trunk docs! –  Calvin Cheng Jan 26 '12 at 13:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.