WMS GetMap not using Lat/Lonprojection
McGraw, Joanne
mcgrawj at AGR.GC.CA
Tue May 3 06:57:51 PDT 2005
Oops. Forgot the attachment.
-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of McGraw, Joanne
Sent: Tuesday, May 03, 2005 9:52 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] WMS GetMap not using Lat/Lonprojection
Hello Bart,
Thank you for responding. I've tried implementing your suggestions. But, have had no luck so far.
1. In my map file, I added a config line within the map object:
config PROJ_LIB /usr/local/proj-4.4.5/nad/
And have verified that the epsg data file actually exists there. The NAD83 still does not appear when I try to display the layer in map mode. There is no error or anything, just a blank display as though the contents simply don't fall within the extents of the map (I have triple checked this possibility).
2. I have changed my GetMap request to read (note the srs parameter at the end):
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&srs=epsg:4267
The WMS GetMap request still seems to be projecting the output. I don't believe it is defaulting to a lat/long of any kind. The attached image (the result of the GetMap request) looks more like an lcc or utm of some kind.
Any other ideas? I have to admit I am less concerned about the first problem, as it may just be a bug that has been taken care of in a later version. The WMS GetMap request is a little disconcerting though, particularly now that I am specifically requesting "srs=epsg:4267" and it doesn't appear to be returning it to me in that projection.
Cheers,
jtm
-----Original Message-----
From: Bart van den Eijnden [mailto:BEN at Syncera-ITSolutions.NL]
Sent: Tuesday, May 03, 2005 3:46 AM
To: McGraw, Joanne; MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] WMS GetMap not using Lat/Lonprojection
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GetMap.png
Type: image/png
Size: 5715 bytes
Desc: GetMap.png
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050503/f1c069c2/attachment.png>
More information about the MapServer-users
mailing list