[mapserver-users] Re: Reprojecting cascading WMS requests (Rob)
Rob
gis at vanbooth.com
Tue Jul 14 02:11:07 PDT 2009
Hi Mark
Thanks for the reply. But I am already putting the projection
information in three places arent I?
MAP
PROJECTION
"init=epsg:27700"
END
WEB
METADATA
"http://localhost/cgi-bin/mapserv.exe?map=example.map&"
WMS_SRS "EPSG:27700 ESPG:4326"
END
END
LAYER
NAME "layer"
CONNECTION "http://externalwmshost/&"
CONNECTIONTYPE WMS
METADATA
"wms_srs" "EPSG:27700"
END
END
The external WMS only supports 27700 - thats why I want to reproject
in my mapserver instance.
Any other clues?
Thanks
Rob
2009/7/10 Mark Volz <MarkVolz at co.lyon.mn.us>:
> Rob,
>
> Anyone can correct me if I am wrong on this however I think you have to enter
> projection information in 3 times.
>
> 1) the projection of your map
> 2) the projection of your data, in this case the wms service so that
> mapserver knows what to reproject from.
> 3) the projection that you are requesting from the wms service - in the
> metadata section.
>
> I am doing this on some of my applications so let me know if your having
> trouble, otherwise if someone has a better thought let me know if I am
> wasting lines of code.
>
> Example:
>
> MAP
> ...
> Projection # of the Map
> End Projection
> ...
> ..
> Layer
> Projection # of the Source
> End Projection
> ...
> Metadata
> "wms_srs" "ESPG:27700" #projection you are requesting in WMS
> ....
> End #Metadata
> ...
> End #layer
>
> Mark Volz
> GIS Specialist
> Lyon County, MN
> (507) 532-8218
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 10 Jul 2009 17:23:28 +0100
> From: Rob <gis at vanbooth.com>
> Subject: [mapserver-users] Reprojecting cascading WMS requests
> To: mapserver-users at lists.osgeo.org
> Message-ID:
> <2a955f950907100923m1ad368b7m8eb9e00727d29baa at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi
>
> I'm obviously having Friday afternoon blindness, as I can't see what I
> am doing wrong! I am trying to set up a basic Mapserver install (MS4W
> v3.0 Beta 4)
>
> MapServer version 5.4.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
> OUTPUT=PDF
> OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE
> SUPPORTS=ICO
> NV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
> SUPPORTS=WFS_SERVER
> SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI
> SUP
> PORTS=THREADS SUPPORTS=GEOS SUPPORTS=RGBA_PNG INPUT=JPEG INPUT=POSTGIS
> INPUT=OGR
> INPUT=GDAL INPUT=SHAPEFILE
>
>
> which points to a WMS service which only supports a single projection.
> I want to get my Mapserver to reproject that data on the fly to other
> projection systems, but don't seem to be doing it right!
>
> This is my mapfile
>
> MAP
> NAME SPIRIT
> STATUS ON
> SIZE 600 600
> EXTENT 0 0 650000 1300000
> UNITS METERS
> SHAPEPATH "temp"
> IMAGECOLOR 255 255 255
> #FONTSET 'fontset.txt'
>
> #SYMBOLSET 'temp/examples.sym'
>
> IMAGETYPE JPEG
> IMAGEQUALITY 75
>
> IMAGETYPE png
> OUTPUTFORMAT
> NAME png
> DRIVER "GD/PNG"
> MIMETYPE "image/png"
> IMAGEMODE rgb
> END
>
> IMAGETYPE jpeg
> OUTPUTFORMAT
> NAME jpeg
> DRIVER "GD/JPEG"
> MIMETYPE "image/jpeg"
> IMAGEMODE rgb
> END
>
> PROJECTION
> "init=epsg:27700"
> END
>
> WEB
> IMAGEPATH "c:\temp\"
> METADATA
> WMS_TITLE "WMS Server"
> WMS_ABSTRACT "WMS Server."
> WMS_ONLINERESOURCE
> "http://localhost/cgi-bin/mapserv.exe?map=example.map&"
> WMS_SRS "EPSG:27700 ESPG:4326"
> END
> END
>
> LAYER
> NAME "layer"
> TYPE RASTER
> STATUS ON
> CONNECTION "http://externalwmshost/&"
> CONNECTIONTYPE WMS
> METADATA
> "wms_srs" "EPSG:27700"
> "wms_name" "layername"
> "wms_server_version" "1.1.1"
> "wms_formatlist" "image/png,image/jpeg"
> END
> END
>
> END
>
> END # Map File
>
>
> but when I make a WMS request against it
>
> http://localhost/cgi-bin/mapserv.exe?map=example.map&request=getmap&service=w
> ms&layers=layer&bbox=53.5,1.4,53.51,1.41&width=400&height=400&version=1.1.1&s
> rs=EPSG:4326&format=jpeg
>
> I get
>
>
> <?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
> <!DOCTYPE ServiceExceptionReport SYSTEM
> "http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd">
> <ServiceExceptionReport version="1.1.1">
> <ServiceException code="InvalidSRS">
> msWMSLoadGetMapParams(): WMS server error. Invalid SRS given : SRS
> must be valid for all requested layers.
> </ServiceException>
> </ServiceExceptionReport>
>
> I'm guessing I'm missing something simple, but I don't know what it
> is. Any help gratefully accepted!
>
> Thanks
>
> Rob
>
>
More information about the MapServer-users
mailing list