WMS and SRS
Daniel Goetz
madprof at GMX.CH
Fri Jul 28 02:18:41 PDT 2006
Hi Bart,
thank you again for your help.
I am sorry, but I think because of my limited skills in writing in english you have misunderstood what I wanted to say. Sorry for that.
I meant in my last email that the EXTENT in a mode=browse ("normal" mapserver CGI request) is the equivalent to the BBOX-values in the WMS-GetMap-request. And that SIZE in "normal" mapserver request is equivalent to WIDTH/HEIGHT in WMS-GetMap-requests. Am I right? And the EXTENT-values and the BBOX-values did not alter; neither in the WMS-request nor in the "normal" mode=browse CGI mapserver-request. Same with SIZE and WIDTH/HEIGHT. And nevertheless these values did not alter in the two different requests, the returened reprojected maps differ (stretching).
> I think the stretching behaviour (non square pixels) is specific to WMS
> and won't happen in Mapserver CGI mode.
It is the map of the "normal" mode=browse mapserver-request that seems to be stretched compared to the not reprojected map. The reprojected map of the WMS-GetMap-request looks similar/equal to the not reprojected map.
But isn't it quiet normal that reprocetion causes some kind of stretching and distortion? Please correct me if I am wrong.
So thank you for your reply. And sorry for my bad english/description of my problems. Thank you for furhter support in advance.
regards
Daniel
-------- Original-Nachricht --------
Datum: Fri, 28 Jul 2006 10:52:39 +0200
Von: "Bart van den Eijnden (OSGIS)" <bartvde at xs4all.nl>
An: Daniel Goetz <madprof at GMX.CH>
Betreff: Re: [UMN_MAPSERVER-USERS] WMS and SRS
> Hi Daniel,
>
> I think the stretching behaviour (non square pixels) is specific to WMS
> and won't happen in Mapserver CGI mode.
>
> For WMS, the SIZE and EXTENT of the MAP file don't matter, since they
> are specified in the request.
>
> The easiest is to test with a square image. So eg 400 x 400 pixels.
>
> Then make sure that MAXX-MINX equals MAXY-MINY (BBOX=MINX,MINY,MAXX,MAXY).
>
> Best regards,
> Bart
>
> Daniel Goetz wrote:
>
> >Hi Bart,
> >
> >thank you for your reply.
> >
> >But the extent in the mapfile is the same as the BBOX-values in the
> WMS-request. And the SIZE in the MAP-object of the mapfile is the same as in
> WIDTH+HEIGHT in the WMS-request. And nevertheless the two "reprojected" maps
> differ in appearance (distortion).
> >
> >But you are right. I should check that the BBOX and the
> WIDTH/HEIGHT-values have the same proportion. Do I also have to check wheter SIZE and EXTENT
> in the MAP-object have the same proportions as well? And how can I measure
> the distance between the vertices of my EXTENT and the distance between
> the vertices of my BBOX? Any suggestion?
> >
> >Thank you for your help and hopefully your further ideas. Thank you.
> >
> >
> >regards
> >
> >
> >Daniel
> >
> >
> >-------- Original-Nachricht --------
> >Datum: Fri, 28 Jul 2006 10:26:38 +0200
> >Von: "Bart van den Eijnden (OSGIS)" <bartvde at xs4all.nl>
> >An: Daniel Goetz <madprof at GMX.CH>
> >Betreff: Re: [UMN_MAPSERVER-USERS] WMS and SRS
> >
> >
> >
> >>Hi Daniel,
> >>
> >>please remember that if the ratio of your bbox and the ratio of your
> >>width versus height in pixels, differs, the map will be stretched. That
> >>could explain some of the behaviour. You need to make sure that the
> >>values in your WMS request have the same ratio. I don't know if this is
> >>the problem, but it could be a cause.
> >>
> >>Proj.4 has a utility to reproject. The proj utilities also come with
> >>MS4W. See also:
> >>
> >>http://proj.maptools.org/man_cs2cs.html
> >>
> >>Best regards,
> >>Bart
> >>
> >>Daniel Goetz wrote:
> >>
> >>
> >>
> >>>Hi,
> >>>
> >>>thank you Frank, Trond and Ed for your help. I tried to use reporjected
> >>>
> >>>
> >>coordinates as BBOX-values in my "new" WMS-GetMap-request
> (SRS=WPSG:4326)
> >>and it works now. I got the new reprojected coordinates out of the
> >>GetCapabilities document (I took them out of the LatLonBoundingBox
> paragraph in the
> >>GetCapabilities document):
> >>
> >>
> >>><Layer queryable="1" opaque="0" cascaded="0">
> >>> <Name>VIEW_RWG_TBS</Name>
> >>> <Title>RWG_TM_NR</Title>
> >>> <SRS>EPSG:31468</SRS>
> >>> <SRS>EPSG:4326</SRS>
> >>> <LatLonBoundingBox minx="10.9905" miny="49.3319" maxx="11.2852"
> >>>
> >>>
> >>maxy="49.5441" />
> >>
> >>
> >>> <BoundingBox SRS="EPSG:31468"
> >>> minx="4.42695e+006" miny="5.46647e+006"
> >>>
> >>>
> >>maxx="4.44806e+006" maxy="5.48982e+006" />
> >>
> >>
> >>> <Style>
> >>> <Name>default</Name>
> >>> <Title>default</Title>
> >>> <LegendURL width="20" height="10">
> >>> <Format>image/png</Format>
> >>> <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
> >>>
> >>>
> >>xlink:type="simple"
> >>xlink:href="http://10.65.112.50/cgi-bin/mapserv.exe?map=/ms4w/apache/htdocs/WMS/WMS_BRWK.map&version=1.1.1&service=WMS&request=GetLegendGraphic&layer=VIEW_RWG_TBS&format=image/png"/>
> >>
> >>
> >>> </LegendURL>
> >>> </Style>
> >>> </Layer>
> >>>
> >>>
> >>>But I have two further questions:
> >>>
> >>>When I do a WMS-GetMap-request in the "new" SRS (EPSG:4326) the map
> >>>
> >>>
> >>maserver sends back does not vary form the map mapserver generates when
> sending
> >>a GetMap-request in the "original" SRS (EPSG:31468). I mean there is no
> >>deformation/distortion noticeable. But when I do a "normal" mapserver
> >>mode=browse-request in my simple pan and zoom template and tell
> mapserver to
> >>reproject the data in EPSG:4326 (I do that by putting the
> PROJECTION-object in
> >>the MAP-object of the .map-file to "init=epsg:4326" while the
> >>PROJECTION-objects in the LAYER-objects are still in the "origninal"
> "init=epsg:31468"
> >>projection. Of course I change the EXTENT-parameters in the .map-file
> too. Am
> >>I doing right?) the returned map looks different >from the map
> genereated
> >>using the "original" projection. I mean that the reprojected map using
> >>mode=browse looks deformed/distorted compared to the "original" not
> reprojected
> >>map.
> >>
> >>
> >>>The question is now: Why do the two maps (the reprojected one I get
> from
> >>>
> >>>
> >>the WMS-GetMap-request and the reprojected map I get by a mode=browse
> >>request) differ in their appearence (distortion) although I tell
> mapserver in
> >>both cases to reproject the map to "epsg:4326"?
> >>
> >>
> >>>The secoond question is: As mentioned I got the "new" reprojeted
> >>>
> >>>
> >>coordinates for BBOX-values out of the GetCapabilities document. But is
> there a
> >>program that could do coordinate transformation for me, so that I am
> able to
> >>transform "epsg:31468" coordinates to "epsg:4326" coordinates?
> >>
> >>
> >>>OK, that's it. Thak you again for your helpful hints. And would be very
> >>>
> >>>
> >>nice of you if you could help me further on with my problems/questions
> >>elucidated in this email. Thank you so much.
> >>
> >>
> >>>regards
> >>>
> >>>Daniel
> >>>
> >>>
> >>>-------- Original-Nachricht --------
> >>>Datum: Thu, 27 Jul 2006 09:22:21 -0400
> >>>Von: Ed McNierney <ed at TOPOZONE.COM>
> >>>An: MAPSERVER-USERS at LISTS.UMN.EDU
> >>>Betreff: Re: [UMN_MAPSERVER-USERS] WMS and SRS
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>Daniel -
> >>>>
> >>>>I think Frank's theory is likely to be correct, and that there is a
> >>>>problem with the BBOX coordinates used in your new request. It sounds
> >>>>
> >>>>
> >>like the
> >>
> >>
> >>>>changes you made are fine, although I think it is not necessary to add
> >>>>
> >>>>
> >>all
> >>
> >>
> >>>>supported SRS systems to the metadata for each layer - just the
> >>>>
> >>>>
> >>MAP-level
> >>
> >>
> >>>>metadata should be all you need to do.
> >>>>
> >>>>Can you post the SRS= and BBOX= parameters you are using in your
> >>>>
> >>>>
> >>original
> >>
> >>
> >>>>epsg:31468 request and in the new epsg:4326 requests?
> >>>>
> >>>> - Ed
> >>>>
> >>>>Ed McNierney
> >>>>President and Chief Mapmaker
> >>>>TopoZone.com / Maps a la carte, Inc.
> >>>>73 Princeton Street, Suite 305
> >>>>North Chelmsford, MA 01863
> >>>>ed at topozone.com
> >>>>(978) 251-4242
> >>>>
> >>>>-----Original Message-----
> >>>>From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]
> On
> >>>>Behalf Of Daniel Goetz
> >>>>Sent: Thursday, July 27, 2006 3:05 AM
> >>>>To: MAPSERVER-USERS at LISTS.UMN.EDU
> >>>>Subject: [UMN_MAPSERVER-USERS] WMS and SRS
> >>>>
> >>>>Hi coummunity,
> >>>>
> >>>>I built up a littel WMS-server with umn-mapserver (local installation;
> >>>>ms4w 2.1). The "original" projection of the single Layers is alway
> >>>>
> >>>>
> >>epsg:31468
> >>
> >>
> >>>>(these are cartesian Gauß-Krüger-coordiantes). So I set the
> >>>>PORJECTION-object of each LAYER and in the MAP-object to
> >>>>
> >>>>
> >>"init=epsg:31468". In the
> >>
> >>
> >>>>METADATA of the MAP-object as well as in the single LAYER-objects I
> >>>>
> >>>>
> >>defined
> >>
> >>
> >>>>"wms_srs" as "EPSG:31468" as well. For testing purpose I did some
> >>>>WMS-GetMap-Requests with "SRS=EPSG:31468" and everything went fine.
> >>>>
> >>>>But now I want to make my WMS-service more interchangeable, so I want
> to
> >>>>define some more SRSs in that the WMS should be able to be displayed.
> I
> >>>>
> >>>>
> >>want
> >>
> >>
> >>>>to make it possible to "transform" (don't know the exact word in
> >>>>
> >>>>
> >>english)
> >>
> >>
> >>>>the WMS from its original Projection to another SRS (e.g. WGS 84;
> >>>>EPSG:4326). In my opinion this should be possible by adding another
> >>>>
> >>>>
> >>epsg-code to the
> >>
> >>
> >>>>METADATA. So my METADATA (both in the MAP and in the LAYERs-objects)
> >>>>
> >>>>
> >>look
> >>
> >>
> >>>>like this: "wms_srs" "EPSG:31468 EPSG:4326".
> >>>>
> >>>>But now every time I change the SRS block in my WMS-GetMap-request
> from
> >>>>"SRS=EPSG:31468" to "SRS=EPSG:4326" mapserver returns a blank image. I
> >>>>
> >>>>
> >>even
> >>
> >>
> >>>>tried to set the BBOX to latlon-coordinates when using "SRS=EPSG:4326"
> >>>>
> >>>>
> >>but
> >>
> >>
> >>>>even this failed. I also testes other SRSs (both geographic ones and
> >>>>
> >>>>
> >>real
> >>
> >>
> >>>>projections) but with no success.
> >>>>
> >>>>Could anybody please give me some help or hints what to do and what
> went
> >>>>wrong and why did this happen? I would be very glad and thankful.
> Thank
> >>>>
> >>>>
> >>you
> >>
> >>
> >>>>so much.
> >>>>
> >>>>
> >>>>regards
> >>>>
> >>>>
> >>>>Daniel
> >>>>
> >>>>
> >>>>--
> >>>>
> >>>>
> >>>>Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> >>>>Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>>
> >>--
> >>Bart van den Eijnden
> >>OSGIS, Open Source GIS
> >>http://www.osgis.nl
> >>
> >>
> >>
> >
> >
> >
>
>
> --
> Bart van den Eijnden
> OSGIS, Open Source GIS
> http://www.osgis.nl
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
More information about the MapServer-users
mailing list