[mapserver-users] Mapserver WMS Reprojection

Donald Kerr donald.kerr at dkerr.co.uk
Sun May 19 12:35:36 PDT 2013


Hi List,

I am trying to reproject a WMS request from 27700 (UK Ordnance Survey) to
900913 (OSM OpenStreetMap) without success. There no issue with the map file
map or layer definitions in terms of serving up the WMS in 27700 but
reprojection seems to fail. There appears to be very little online and I
cannot find a solution; hence this request for help or advice.

Relevant parts of map file (some parts removed):

PROJECTION
    "init=epsg:27700"
END

WEB
    METADATA
        "wms_title" "My WMS"
        "wms_onlineresource"  "http://localhost/mapserver/mapserv.asp?"
        "wms_srs" "EPSG:27700  EPSG:900913"
        "wms_enable_request" "*"
        "wms_abstract" "My WMS" 
        "wms_extent" "0 0 670000 1230000"
        "wms_feature_info_mime_type" "text/plain"
        "wms_feature_info_mime_type" "text/html"
        "wms_feature_info_mime_type" "application/vnd.ogc.gml" #
&info_format=application/vnd.ogc.gml
...

Layer:

METADATA
    "wms_title" "CME"
    "wms_extent" "0 0 670000 1230000"
#    "wms_srs" "EPSG:27700 EPSG:900913"
    "wms_include_items" "all" # No spaces
    "gml_include_items" "all" # No spaces
    "gml_featureid" "ID"
END

PROJECTION
    "init=EPSG:27700"
END # PROJECTION

Openlayers request:

http://maps1/cgi-bin/mapserv.exe?MAP=D:\MyMapFile.map&LAYERS=CME&TRANSPARENT
=TRUE&FORMAT=png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3
A900913&BBOX=-484682.60504583,7512726.3043776,-415889.27960147,7547122.96709
97&WIDTH=900&HEIGHT=450

The result is a transparent image with no data showing. :( The same map file
works correctly and serves an image if used with Openlayers and a map on
EPSG 27700 so it's pointing at the reprojection of the BBOX maybe.

What am I doing wrong? Any help greatly appreciated.

Many thanks.

Regards,

Donald



More information about the mapserver-users mailing list