[mapserver-users] OSM via mapserver setup help?

Lars Lingner gislars+list at googlemail.com
Sun Jul 5 02:31:41 PDT 2015


Hi Brent,

On 05.07.2015 03:46, Brent Wood wrote:
> Hi, I'm looking to create a WMS & WM(T)S server for OSM data in New
> Zealand, on Mint 17 (Ubuntu 14.04 Trusty LTS)
> 
> I have followed the instructions
> here:https://github.com/mapserver/mapserver/wiki/Rendering-OSM-data-on-Ubuntu-12.04

These are still valid as far as I can tell. Keep in mind that your
system may have individual settings like where to store the data, what
user accounts and permissions are available. These where often the
things I had to struggle with.

[...]
> have got mapserver working as a cgi OK - with the usual error message
> to say it is working from the browser, "No query information to
> decode. QUERY_STRING is set, but empty."

That is actually a good sign. I would try to get MapServer running first
and then configure MapCache.

MapServer needs to be told where the mapfile is and what the request is
about. At first I'd try a capabilities request like this:

http://yourserver.tld/cgi-bin/mapserv?map=/path/to/your/mapfile.map&REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1

If everything is fine, you'll get the capabilities document in xml format.

The path to your mapfile needs to be accessible by MapServer/webserver
and regarding security aspects it shouldn't be accessible from outside
world.

How did you configure your webserver with cgi and MapServer? Can you
show some configuration like a vhost file from apache?

When MapServer can't access it, you will get an error message about it.
When it is accessible but it have configuration issues within your
mapfile, you will also get a error message most often with a hint where
in your mapfile the (first) error is. The message is displayed in your
browser and probably in you webserver error log file.
If you are interested in verbose messages you can enable DEBUG [1] in
your mapfile. There you can set a global logging and logging at layer
level and log everything in an separate file.

Even if your mapfile is syntactically correct and all your data sources
are configured properly, especially projections and expressions for
filtering, you can end up getting a completely white (depending on your
background color) image.
That happens when you are requesting via GetMap an area where you have
no data or your mapfile simply don't have a configuration for this
specific bounding box and/or scale.

Here is a valid GetMap request from the MapServer docs [2]

http://my.host.com/cgi-bin/mapserv?
map=mywms.map&
SERVICE=WMS&
VERSION=1.1.1&
REQUEST=GetMap&
LAYERS=prov_bound&
STYLES=&
SRS=EPSG:4326&
BBOX=-173.537,35.8775,-11.9603,83.8009&
WIDTH=400&
HEIGHT=300&
FORMAT=image/png

That implies that the server can access mywms.map AND is actually
serving projection with epsg:4326 (*) AND your mapfile as a layer
configured with name prov_bound AND you have data within this BBOX.

For testing MapServer you don't have to craft the requests by hand. I'm
using the build in openlayers mode [3] and Qgis [4].


Best wishes

Lars

(*) when a WMS isn't serving epsg:4326 it isn't actually a WMS regarding
the OGC official standard.

[1] http://mapserver.org/optimization/debugging.html
[2] http://mapserver.org/de/ogc/wms_server.html
[3] http://mapserver.org/de/cgi/openlayers.html
[4] http://qgis.org/


More information about the mapserver-users mailing list