[Mapserver-users] WMS client re-projection errors

Matthew Perry mtperry78 at sbcglobal.net
Tue Jul 13 18:00:49 EDT 2004


Paul,
 Thanks for the response. I tried some of your
suggestions....

> Change your output projection to 26910, so that your
> vectors are being 
> datum shifted but your image is not. 

This still requires the WMS image to be transformed
from wgs84 to nad83. Predictably, the image is still
mis-aligned.

> If things are still not working, try setting your
> output projection to 
> 4326, so your vectors are being tranformed into the
> native projection of 
> your raster. 

Eureka! The layers are aligned regardless of their
position on the image...

http://darkstar.rr.nu/cgi-bin/mapserv?mode=map&map=/var/www/htdocs/klamath2/klamath2.map&mapext=-121.848094294579+42.7195258065662+-121.742700618268+42.7713535046386&mapsize=610+420&layers=Roads+Shaded_relief

Unfortunately, for a number of reasons, I need to keep
the map in the native projection of my vector layers.

Based on my wild guess, It seems as if mapserver is
not requesting the correct bounding box from the WMS
when the datum shift (wgs84->nad27/nad83) is involved.
Would this be a correct assumption? 

Matthew Perry
Humboldt State


-----------------------------
> 
> Matthew Perry wrote:
> 
> > Hi folks,
> >   
> >   I have some shapefiles in UTM, NAD27, Zone 10
> > (epsg:26710) which I'm trying to overlay on a WMS
> > shaded relief layer from the USGS in Geographic,
> WGS84
> > (epsg:4326). The problem is a noticable distortion
> on
> > the y axis. Features line up at the center of the
> > image, but become more and more distorted as you
> move
> > above or below the center-line. 
> > 
> > These three images should capture the idea (keep
> your
> > eye on the peak in relation to the roads around
> it):
> > 
> > http://darkstar.rr.nu/download/mapserv1.jpg
> > http://darkstar.rr.nu/download/mapserv2.jpg
> > http://darkstar.rr.nu/download/mapserv3.jpg
> > 
> > 
> > It is almost as though the WMS image is vertically
> > compressed. However, when using a WMS image from
> > terraserver (nad83), the map is aligned properly.
> I am
> > running mapserver 4.2.0 on slackware linux with
> proj
> > 4.4.7 & the datum shift files. Perhaps the
> requested
> > WMS extents are not accurate because of the datum
> > shift?? Is there something unique to shifting from
> > wgs84 to nad27?? Anyone have any ideas?
> > 
> > 
> > The abbreviated mapfile is as follows:
> > -----------------------------
> > MAP
> > 
> >   PROJECTION
> >     "init=epsg:26710"
> >     # UTM zone 10, Nad27, meters
> >   END
> > 
> >   LAYER
> >     NAME "Shaded_relief"
> >     GROUP "bg"
> >     STATUS OFF
> >     TYPE RASTER
> >     CONNECTIONTYPE WMS
> >     CONNECTION
> >
>
"http://gisdata.usgs.net:80/servlet/com.esri.wms.Esrimap?servicename=USGS_WMS_NED&"
> >     METADATA
> >       "wms_srs"    "EPSG:4326"
> >       "wms_title"    "Shaded Relief"
> >       "wms_name"    "US_NED_Shaded_Relief"
> >       "wms_server_version"    "1.0.0"
> >       "wms_format"    "image/png"
> >       "wms_group_title" "background"
> >     END
> >     PROJECTION
> >       "init=epsg:4326"
> >     END
> >   END
> > 
> >   LAYER
> >     NAME "Roads"
> >     STATUS OFF
> >     DATA "clip1"
> >     TYPE LINE
> >     TOLERANCE 2
> >     DUMP true
> >     METADATA
> >       "wms_title"    "Klamath Basin Roads"
> >       "wms_srs"    "EPSG:26710"
> >       "wms_abstract" ""
> >       "wfs_title"   "Klamath Basin Roads"
> >       "wfs_srs"    "EPSG:26710"
> >       "wfs_abstract" ""
> >     END
> >     CLASS
> >       NAME "Roads"
> >       STYLE
> >         SYMBOL 1
> >         SIZE 2
> >         COLOR 0 0 0
> >       END
> >     END
> >   END
> > 
> > END
> > ---------------------------------
> > 
> > 
> > Here is a link to a small, clipped shapefile if
> anyone
> > feels inclined to try it out...
> > 
> > http://darkstar.rr.nu/download/clip1.zip
> > 
> > 
> > ... and the urls to recreate the three sample
> images
> > are:
> > 
> >
>
http://localhost/cgi-bin/mapserv?mode=map&map=/var/www/htdocs/klamath2/klamath2.map&mapext=594418.2128140883+4727975.646318736+602962.0885061937+4733853.945029724&mapsize=610+420&layers=Roads+Shaded_relief
> > 
> >
>
http://localhost/cgi-bin/mapserv?mode=map&map=/var/www/htdocs/klamath2/klamath2.map&mapext=594411.1981378223+4730115.122579895+602955.0738299277+4735993.421290884&mapsize=610+420&layers=Roads+Shaded_relief
> > 
> >
>
http://localhost/cgi-bin/mapserv?mode=map&map=/var/www/htdocs/klamath2/klamath2.map&mapext=594411.1981378224+4726172.874518348+602955.0738299278+4732051.173229337&mapsize=610+420&layers=Roads+Shaded_relief
> > 
> > -----------------------------------
> > 
> > Thanks... Any ideas are greatly appreciated!!
> > 
> > Matthew Perry
> > Humboldt State University
> > Natural Resources Planning
> > 
> > _______________________________________________
> > 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