[Mapserver-users] WMS client re-projection errors
Matthew Perry
mtperry78 at sbcglobal.net
Tue Jul 13 15:19:24 PDT 2004
Paul,
Even if I pretend the WMS & the map are nad83
(epsg:4269right?) the image is still mis-aligned. In
fact, the only way to get a proper image is to set the
map to
4326.
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??
- matt
--- Paul Ramsey <pramsey at refractions.net> wrote:
> Oh, interesting... yeah, you would get better shifts
> in 83<->27 because
> the grid shift files are there, whereas for WGS84 it
> would have to do a
> much simpler mathematical transform. Try pretending
> that your WGS84 data
> is actually NAD83 (the spheroids are practically
> identical) and see if
> things get better.
>
--- Paul Ramsey <pramsey at refractions.net> wrote:
> My guess is that the act of stuffing the WMS through
> a datum transform
> is messing things up... what happens if you set your
> output to 26910,
> and set the projection object in your WMS layer to
> be 4269 (NAD 83
> lat/lon) instead of 4236? (ie, pretend your image is
> in NAD83, so that
> mapserver does not attempt to datum shift it.
>
> If things still fail, then it is time to turn up the
> logging and see
> what the WMS requests to USGS are. Your suspicion
> that Mapserver might
> be asking for incorrect bounding boxes from USGS
> when doing transforms
> might be correct.
>
> Paul
>
> Matthew Perry wrote:
>
> > 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
> >>>
>
=== message truncated ===
More information about the MapServer-users
mailing list