WMS GetMap not using Lat/Lon projection

Bart van den Eijnden BEN at SYNCERA-ITSOLUTIONS.NL
Tue May 3 00:46:24 PDT 2005


Hi,

1) can your server access the PROJ library? Is the PROJ_LIB variable set?

2) officially your WMS request is not valid. You always need to specify the reference system you want to use, ie SRS, maybe Mapserver defaults to EPSG:4326 for WMS which explains the reprojection.

Best regards,
Bart

Bart van den Eijnden
Syncera-ITSolutions
Postbus 270
2600 AG  DELFT

tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl

>>> "McGraw, Joanne" <mcgrawj at AGR.GC.CA> 05/02/05 09:31pm >>>
Hello all,

 

I'm hoping someone can help with two problems I am having, both of which are related to projections.

 

1. My first problem is a map file I created in which I set the Map object's projection to "init=epsg:4267" (Lat/Long, NAD27) and it contains a layer for a shapefile whose projection is "init=epsg:4269" (Lat/Long, NAD83). When I try to display this layer using map mode with MapServer on my local machine it works, but it will not work on our corporate server. All other layers (that are also Lat/Long, NAD27) in the map file work. I am running MapServer version 4.4.1 for Windows on my local machine, but am running 4.4.0 for Linux on our corporate server. Is this a known problem? And, if so, is there a workaround besides upgrading the 4.4.0 installation to 4.4.1? 

 

2. I created the pei.map file listed below. The map's projection is set to "init=epsg:4267" (Lat/Long, NAD27) and it contains a layer for a shapefile whose projection is also "init=epsg:4267" (Lat/Long, NAD27). This layer also provides WMS support. 

 

In a web browser, I use the following URLs to display the data...first using map mode and second using WMS' GetMap capabilities:

 

1. To display Map mode results (see MapMode.png for image):

http://wms1.agr.gc.ca/cgi-bin/://localhost/cgi-bin/mapsrv.exe?map=/ms4w/apps/OWS_TestData/map/pei.map&mode=map&layer= peiLayer 

 

2. To display WMS GetMap image (see GetMap.png for image):

http://wms1.agr.gc.ca/cgi-bin/://localhost/cgi-bin/mapsrv.exe?map=/ms4w/apps/OWS_TestData/map/pei.map&service=wms&version=1.1.1&request=GetMap&layers= peiLayer 

 

When I compare the images generated by these two different processes, the one generated for Map mode appears to display in lat/long, however, the WMS GetMap data seems to be getting projected. To what projection, I have no idea but the differences can be seen in the two attached images "MapMode.png" and "GetMap.png." This behaviour occurs on both my 4.4.1 and 4.4.0 servers. 

 

Why are the two outputs displaying the data differently?

 

Any pointers that will help with these problems is greatly appreciated.

 

Cheers,

jtm

 

map

    name                                    pei

    status                                   on

    size                                      400 300

    extent                                   -64.601900 45.879485 -61.366990 47.179725

    units                                     dd

#    units                                    meters

    shapepath                             "../data"

    imagecolor                            255 255 255

    imagetype                             png

    

# NAD27

    projection

        "init=epsg:4267"

    end # projection

 

    outputformat

        name                                png

        driver                                 "GD/PNG"

        mimetype                          "image/png"

        imagemode                       RGB 

        extension                          "png"

    end # outputformat

 

    web

        imagepath                         "/ms4w/tmp/ms_tmp/"

        imageurl                            "/ms_tmp/"

        metadata

            "wms_title"                    "PEI Test Data"

            "wms_onlineresource"    "http://localhost/cgi-bin/mapsrv.exe?map=/ms4w/apps/OWS_TestData/map/pei.map"

            "wms_srs"                     "EPSG:4267"

            "wfs_title"                      "PEI Test Data"

            "wfs_onlineresource"      "http://localhost/cgi-bin/mapsrv.exe?map=/ms4w/apps/OWS_TestData/map/pei.map"

            "wfs_srs"                       "EPSG:4267"

        end # metadata

    end # web

    

    layer

        name        peiLayer

        type        polygon

        status      off

        dump        true

        data        pei

 

        metadata

            "wms_title"                    "Prince Edward Island"

            "wfs_title"                      "Prince Edward Island"

        end # metadata

        

        class

            color                             -1 -1 -1

            outlinecolor                    0 0 0

        end # class

    end # peiLayer layer

end # map

 

 

 

Joanne T. McGraw
Spatial Data Visualization Specialist / Spécialiste en visualisation des données spatiales
Agriculture and Agri-Food Canada / Agriculture et Agroalimentaire Canada
Telephone/Téléphone: (613) 694-2331 
Facsimile/Télécopieur: (613) 759-1937
960 Carling Ave, #1136
Ottawa, Ontario
K1A 0C6

mcgrawj at agr.gc.ca 

 

 

 



More information about the MapServer-users mailing list