Need help with WMS and Projections

Ed McNierney ed at TOPOZONE.COM
Thu Dec 2 22:04:03 EST 2004


Ken -

Well, that's a horse of a different color <g>.  You might want to ask on
the Chameleon user list, after checking the archives first - this may be
a Chameleon question/issue.

To give you a MapServer answer, each layer in your MAP file will have a
projection defined - either explicitly (preferred) or inherited from the
overall MAP file.  For WMS layers, you can specify a list of projections
- any projections that are supported by the WMS server you're talking
to.  MapServer will generate its OUTPUT image using either the MAP file
projection (in "MapServer" mode) or the SRS parameter passed to it if
it's acting as a WMS server itself.

I've never tried it with EPSG codes I don't have installed, but I
believe that if you list a series of EPSG codes in the "wms_srs"
metadata for the WMS client layer, MapServer will select (a) the
projection that matches its own output projection if available, or (b)
the first projection it understands.  I always make sure I only list
projections I know I have installed, so I'm not certain about that.

I'm not a Chameleon user, but it sounds like you should be expecting the
Chameleon client to make a WMS request to the local MapServer,
specifying the SRS requested as 42304.  MapServer needs to know what
projections the remote WMS server supports, and you need to tell it that
through the wms_srs parameter for that layer.  Simply looking at the
capabilities document yourself and seeing that a familiar projection is
listed will not help MapServer know that; make sure that 4326 is listed
in the wms_srs field for that layer in the MAP file.

        - Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
Phone: +1 978 251-4242   Fax: +1 978 251-1396 


-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Ken
Sent: Thursday, December 02, 2004 7:59 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] Need help with WMS and Projections

Sorry, let me expand a bit on my setup.

I have mapserver setup and running on my server. Using chameleon I have
  applications working, which is what I mean by 'client'. The
application includes my MAP file with some local layers (shp files), as
well it is using chameleon's WMS Browser to load in remote WMS layers on
the fly. So in the case of my client/application I am setting its
projections in the MAP file for that specific application.

So client, is my chameleon application thats running on my server, in
conjunction with mapserver.

Remote layer, would be any WMS served up on the internet that I can
access.

Is that enough information?

Thanks again,

Ken


Ed McNierney wrote:
> Ken -
>
> I'm having a hard time parsing your usage of "client", "my mapserver",

> and "remote".  Could you explain the data flow a little more clearly?
> You say that your "client" requests a "remote" layer and asks for it 
> in its desired projection, and if it can't get it, then "my mapserver"
> somehow appears to reproject it and save the day <g>.  Where did your 
> mapserver come from?  Is it always there, acting as a WMS client to 
> the "remote WMS layer"?  What application is your "client"?  Feel free

> to throw in a little ASCII art....
>
>       - Ed
>
> Ed McNierney
> President and Chief Mapmaker
> TopoZone.com / Maps a la carte, Inc.
> 73 Princeton Street, Suite 305
> North Chelmsford, MA  01863
> Phone: +1 978 251-4242   Fax: +1 978 251-1396
>
> -----Original Message-----
> From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] 
> On Behalf Of Ken Sanderson
> Sent: Thursday, December 02, 2004 7:30 PM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: [UMN_MAPSERVER-USERS] Need help with WMS and Projections
>
> Hello,
>
> I am trying to get my head around how remote WMS layers work with 
> projections and hoping that someone here can steer me in the right 
> direction.
>
> Here is how I have assumed it works. My client goes to a remote WMS 
> layer and first asks for the layer in the projection of the client, if

> it doesnt support that it looks through the SRS tags of the WMS layer 
> and finds the first one that it understands, by understands I mean 
> thats included in my EPSG file, requests the image and my mapserver 
> reprojects it to the projection my client is using.
>
> Thats what I thought, but using a WMS layer has drawn this into 
> question, so is this true or not?
>
> Here is what has brought up the problem.
>
> I have two clients. One is in a projection of 4326 and another 42304 
> (LCC Canada). When I load a specific WMS layer it works in 4326, but 
> would not work in 42304. Here is the SRS info from the remote WMS
layer:
>
>                         <SRS>EPSG:102190</SRS>
>    <SRS>EPSG:42102</SRS>
>    <SRS>EPSG:3005</SRS>
>    <SRS>EPSG:4269</SRS>
>    <SRS>EPSG:4326</SRS>
>    <SRS>EPSG:26708</SRS>
>    <SRS>EPSG:26709</SRS>
>    <SRS>EPSG:26710</SRS>
>    <SRS>EPSG:26711</SRS>
>    <SRS>EPSG:26712</SRS>
>    <SRS>EPSG:26908</SRS>
>    <SRS>EPSG:26909</SRS>
>    <SRS>EPSG:26910</SRS>
>    <SRS>EPSG:26911</SRS>
>    <SRS>EPSG:26912</SRS>
>    <SRS>EPSG:32608</SRS>
>    <SRS>EPSG:32609</SRS>
>    <SRS>EPSG:32610</SRS>
>    <SRS>EPSG:32611</SRS>
>    <SRS>EPSG:32612</SRS>
>
> In my thinking since I have a number of these in my EPSG file, 
> specifically 4326, than I should have no problem loaded the WMS layer 
> into my client, regardless of what projection my client was using.
>
> In order to get this to work in both of my clients I had to add a new 
> projection to my EPSG file. 102190 is BC Albers 42102 projection. As 
> 102190 was the projection listed in the bounding box tag, I simply 
> copied the 42102 and put a new one into my EPSG file with the number 
> 102190.
> Works fine now. While this is working for me, I dont think its really 
> a good solution as I cant be adding new entries to my EPSG file for 
> every WMS layer my users may want to load.
>
> Sorry for this being long, but I really wanted to give all the
details.
> How this has worked out has made me think my prior beliefs to how 
> projections with remote WMS layers worked are wrong. So my question 
> is, how do they work if they dont work the way I thought they did?
>
> Thanks,
>
> Ken
>
>



More information about the mapserver-users mailing list