[Mapserver-users] WMS client re-projection errors

Matthew Perry mtperry78 at sbcglobal.net
Wed Jul 14 13:04:05 EDT 2004


    After turning on layer debugging, I was able to
track the requested WMS url so I ran an experiment to
test my hunch about the image being "compressed" in
the y direction.

-------------------------------------

1) This is the mapserver URL. One of the layers is a
WMS...

http://darkstar.rr.nu/cgi-bin/mapserv?mode=map&map=/var/www/htdocs/klamath2/klamath2.map&mapext=591903.3497686051+4728560.282866988+605103.3396707342+4737642.049318535&mapsize=610+420&layers=Roads+Shaded_relief

SO the UTM (26710) coordinates are:
591903.3497686051 4728560.282866988 605103.3396707342
4737642.049318535

.... transformed to 4326 using postgis:
select
transform(GeometryFromText('BOX3D(591903.3497686051
4728560.282866988 0, 605103.3396707342
4737642.049318535 0)', 26710), 4326);
----> SRID=4326;BOX3D(-121.878969396706
42.7058301491713 0,-121.716141685007 42.7859054067568
0)

....The lat/long (4326) coords are:
-121.878969396706 42.7058301491713 -121.716141685007
42.7859054067568


2) This is mapserver's WMS request:

http://gisdata.usgs.net:80/servlet/com.esri.wms.Esrimap?servicename=USGS_WMS_NED&LAYERS=US%5FNED%5FShaded%5FRelief&REQUEST=GetMap&SERVICE=WMS&FORMAT=image%2Fjpeg&STYLES=&HEIGHT=420&VERSION=1.1.1&SRS=EPSG:4326&WIDTH=610&BBOX=%2D121%2E878969%2C42%2E704140%2C%2D121%2E716142%2C42%2E787600&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage

So the requested LAT/LONG (4326) are:
-121.878969 42.704140 -121.716142 42.787600


3) Subtract (1) minus (2) :


DeltaX1 = -121.878969396706   - -121.878969   
        = -0.000000397 ~> 0
DeltaY1 =   42.7058301491713  -   42.704140   
        =  0.001690149
DeltaX2 = -121.716141685007   - -121.716142   
        =  0.000000315 ~> 0
DeltaY2 =   42.7859054067568  -   42.787600   
        = -0.001694593 

------------------------------------------------

Bingo. The requested WMS extent is larger than the
image extent on the vertical axis! BUT the requested
image size is still 610x420. 

Is this a case of mapserver requesting non-square
pixels?? Why does the mapserver request an image that
is too large in the y direction?? 


Matthew Perry
Humboldt State University
Natural Resources Planning



--- Ed McNierney <ed at topozone.com> wrote:
> This is correct - however, it should be irrelevant
> to Matt's problem.
> MapServer, being the WMS client here (to the USGS
> server) should not be
> REQUESTING non-square pixels.
> 
> 	- Ed 
> 
> 
> 
> Ed McNierney
> President and Chief Mapmaker
> TopoZone.com
> -----Original Message-----
> From: mapserver-users-admin at lists.gis.umn.edu
> [mailto:mapserver-users-admin at lists.gis.umn.edu] On
> Behalf Of Ian Turton
> Sent: Wednesday, July 14, 2004 5:07 AM
> To: Matthew Perry; Mapserver List
> Subject: Re: [Mapserver-users] WMS client
> re-projection errors
> 
> At 23:19 13/07/2004, Matthew Perry wrote:
> 
> >I have noticed that the USGS WMS is slightly evil
> in that if you fudge 
> >the extents on a GetMap request, the image will be
> warped instead of 
> >recalculating a proportional bounding box.
> >
> >What is does the WMS standard say about this?? What
> behavior is 
> >mapserver expecting??
> 
> The USGS wms is doing the right thing. The latest
> version of mapserver
> does this too now I think.
> 
> Ian
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
>
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> 




More information about the mapserver-users mailing list