[mapserver-users] mapserver wms: srs problem

Matthew Pettis matthew.pettis at gmail.com
Mon Jun 9 13:44:39 PDT 2008


Hi Barend, All,

I tried your suggested changes:
====================================================
...
  PROJECTION
    "init=epsg:4326"
  END

    ####################
    # Web settings
    ####################
  WEB
    IMAGEPATH   "C:/ms4w/Apache/htdocs/tmp/"
    IMAGEURL    "/tmp/"
    METADATA
        "wms_title"           "WMS Demo Server"
        "wms_onlineresource"
"http://localhost/cgi-bin/mapserv.exe?center=45,-95&zoom=6"
        "wms_srs"             "EPSG:4326 EPSG:26915"
    END
  END

    ####################
    # State
    # Background shows through missing precincts to show where no
votes will be coming from
    ####################
  LAYER
    NAME              "state"
    METADATA
        "wms_title"   "state"
        "wms_format" "image/png"
    END
...
====================================================

Now, the map is blank (no error messages either).  It looks like i can
drag and zoom per the controls, but there is no image of the state of
MN to move around.  Any idea what could still be the matter?

Thanks,
Matt


On Sun, Jun 8, 2008 at 1:08 PM, Barend Kobben <kobben at itc.nl> wrote:
> It looks like your datastore's SRS is 4326 (latlon on the WGS84). In other
> words, the data in your shapefile, database or raster image are (or are
> advertised to be) in 4326. Its because your data is indeed in that srs
> and/or advertised as such in the Mapfile LAYER as
>
>          PROJECTION
>             "init=epsg:4326"
>          END
>
> But you tell the WMS interface that the layer is in 26915, by setting layer
> metadata srs => EPSG:26915
>
> If you want MS to reproject your data from 4326 to 26915 upon request, make
> sure you set the layerdata projection:
>        PROJECTION
>             "init=epsg:4326"
>          END
>
> Then make sure you tell the WMS interface to advertise it can be reprojected
> to 26915 by setting it in web metadata srs:
>    "wms_srs" "EPSG:4326 EPSG:26915 EPSG:[others you want to offer]"
>
> AFAIK there no wms_srs metadata in the LAYER object...
>
>
> --
> Barend Köbben
> International Institute for Geo-Information
> Sciences and Earth Observation (ITC)
> PO Box 6
> 7500AA Enschede, The Netherlands
> +31 (0)53 4874253
>
>
>
>
>
> On 08-06-08 02:21, "Matthew Pettis" <matthew.pettis at gmail.com> wrote:
>
>> Hi,
>>
>> I am not a GIS guy, and am a bit confused by the projection attributes
>> i have to specify in mapserver.  In particular, I have a simple
>> example.  I have a map that has the following metadata:
>>
>> Horizontal Coordinate Scheme     UTM
>> Ellipsoid  GRS80
>> Horizontal Datum  NAD83
>> Horizontal Units  Meters
>> UTM Zone Number  15
>>
>> I believe this translates to an epsg=26915
>>
>> Now, according to mapserver, I have to specify a projection object, a
>> web metadata srs, and a layer metadata srs.
>>
>> To compress the mapfile, i'll just note what i have specified for each
>> of these settings.
>>
>> First, I would think that this would work:
>>
>> projection => init=epsg:26915
>> web metadata srs => EPSG:26915
>> layer metadata srs => EPSG:26915
>>
>> this give me the error:
>> msWMSLoadGetMapParams(): WMS Server Error. Invalid SRS given.  SRS
>> must be valid for all requested layers.
>>
>> I only have the one layer (it's of the state of MN from www.gis.leg.mn).
>>
>> However, the following renders, but I don't think it is the projection
>> i want (as the top of MN is too wide):
>>
>> projection => init=epsg:26915
>> web metadata srs => EPSG:26915
>> layer metadata srs => EPSG:4326
>>
>> Now, I am using mapserver as a WMS.  Before I was using it NOT as a
>> WMS, but just making it render the shapefile without any projection
>> information, it worked, and it was the projection I had come to expect
>> when seeing the state of MN rendered.
>>
>> Why does my first configuration give me an error?
>> How can I make it render in the way I expect without giving mapserver
>> explicit projection instructions?
>>
>> please forgive the ignorance of map projection knowledge.
>>
>> thanks,
>> matt
>
> International Institute for Geo-Information Science and Earth Observation (ITC)
> Chamber of Commerce: 410 27 560
>
> E-mail disclaimer
> The information in this e-mail, including any attachments, is intended for the addressee only. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or action in relation to the content of this information is strictly prohibited. If you have received this e-mail by mistake, please delete the message and any attachment and inform the sender by return e-mail. ITC accepts no liability for any error or omission in the message content or for damage of any kind that may arise as a result of e-mail transmission.
>



-- 
It is from the wellspring of our despair and the places that we are
broken that we come to repair the world.
-- Murray Waas



More information about the MapServer-users mailing list