[mapserver-users] WMS Server and Custom ESPG code

Rahkonen Jukka jukka.rahkonen at mmmtike.fi
Sat Nov 9 14:50:10 PST 2013


Hi,

To test if the "epsg" file of MS4W is used just make some client to read a map in any supported projection (reprojected from the native) and then delete the definitions from the file. You can do it on-a-fly.

Did you already make a test with the dataset and mapfile which I pointed for you, if I remember right? They work for me here in Finland with those EPSG:97036 settings and with MS4W and I do not see any fundamental reason why they could not be made to work also for you.

-Jukka-
________________________________
Brian Fischer wrote:

> Yes, that is correct.  I’ve double check the string and it all looks right, but maybe I did something wrong.  Even if I had the projection definition wrong, I would still think it would work just the data would not show up in the right location on the map.

> I still go back to that proj file and whether Mapserver is reading it?  According to the documentation for the MS4W distribution of MapServer it should be.  I’m not a programmer so don’t have the skills to look at the code and see in what cases it would give the “Invalid SRS” error from the WMS server?

Brian Fischer
Principal | GIS Project Manager
Houston Engineering, Inc.
O 763.493.4522 | D 763.493.6664 | F 763.493.5572

From: Donald Kerr [mailto:donald.kerr at dkerr.co.uk]
Sent: Friday, November 01, 2013 4:54 PM
To: Brian Fischer; mapserver-users at lists.osgeo.org
Subject: RE: [mapserver-users] WMS Server and Custom ESPG code

So adding it to the EPSG file does not work? If that’s the case then the sting may be incorrect.

Regards,
Donald


From: Brian Fischer [mailto:bfischer at houstoneng.com]
Sent: 01 November 2013 21:47
To: Donald Kerr; mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
Subject: RE: [mapserver-users] WMS Server and Custom ESPG code

I can get the re-projection to work just fine, but not with a ESPG code that is not already defined in the Proj espg file.   For example I can go from my custom coordinate system to 3857, but I cannot serve it out using my custom code.

I think what is different about your example and mine is that in your’s case you have the EPSG code that already exists and in my case I am trying to use a new espg number that does not previously exists.

Thanks,

Brian Fischer
Principal | GIS Project Manager
Houston Engineering, Inc.
O 763.493.4522 | D 763.493.6664 | F 763.493.5572

From: Donald Kerr [mailto:donald.kerr at dkerr.co.uk]
Sent: Friday, November 01, 2013 4:45 PM
To: Brian Fischer; mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
Subject: RE: [mapserver-users] WMS Server and Custom ESPG code


MAP

WEB

METADATA

"wms_srs" "EPSG:27700 EPSG:900913" #Additional projections do not need to be set in LAYER if set here



List your map projection and the reprojection as above and try that.



Regards,



Donald


From: mapserver-users-bounces at lists.osgeo.org<mailto:mapserver-users-bounces at lists.osgeo.org> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Brian Fischer
Sent: 01 November 2013 21:20
To: mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
Subject: Re: [mapserver-users] WMS Server and Custom ESPG code

Thanks for the reply!  It looks like I have everything setup right but seems like MapServer is not reading my espg file in the proj folder.  Here’s the espg definition and here’s my mapfile.  Or maybe it is something with the extent being requested with the SRS but everything looks right. I’m just trying to display the output image in a web browser to validate it is working.

# Chippewa County Coordinates EPSG:97036
<97306> +proj=lcc +lat_0=44.581111111111 +lon_0=-91.29444444444444 +lat_1=45.141666666666 +lat_2=44.813888888888 +x_0=197000 +y_0=0.0 +ellps=GRS80 +datum=NAD83 +k_0=1.0000391127 +a=6378412.542 +b=6357027.8561403 +f=298.270107115315 +to_meter=0.3048006096012192 +no_defs <>

MAP
                NAME 'Basemap'
                SIZE 800 650
                STATUS ON
                EXTENT 68036 80345 326435 279563         #Extent is needed for feature report
                UNITS FEET
                CONFIG "PROJ_LIB" "E:/ms4w/proj/nad"
                INCLUDE "geomoose_globals.map"

                WEB
                                METADATA
                                                'wms_title' 'Basemap'
                                                'wms_srs' 'epsg:97306'
                                                'wms_enable_request' '*'
                                END
                END
                    PROJECTION
                                                'init=epsg:97306'
                   END

                LAYER # County Boundary
                                NAME 'County_Boundary'
                                DATA 'data/county'
                                STATUS ON
                                TYPE POLYGON
                                PROJECTION
                                                'init=epsg:97306'
                                END
                                METADATA
                                                'wms_srs' 'epsg:97306'
                                END
                                CLASS
                                                NAME 'County Boundary'
                                                STYLE
                                                                WIDTH 5
                                                                COLOR -1 -1 -1
                                                                OUTLINECOLOR 100 100 100
                                                END
                                END
                END # County Boundary
END

Here’s the error 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>

Brian Fischer
Principal | GIS Project Manager
Houston Engineering, Inc.
O 763.493.4522 | D 763.493.6664 | F 763.493.5572

From: mapserver-users-bounces at lists.osgeo.org<mailto:mapserver-users-bounces at lists.osgeo.org> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Smith, Michael
Sent: Friday, November 01, 2013 2:26 PM
To: mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
Subject: Re: [mapserver-users] WMS Server and Custom ESPG code

Hi Brian, I have successfully done this as you outline below.

I checked my WMS and they reference c:\ms4w\proj\nad.

In that folder I edited the epsg file

I added the following line to the end of the file:
# ESRI Web Mercator
<102113> +proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +units=m +no_defs

Now I can serve my WMS out as Web Mercator for ArcGIS Online.

===============================
Michael Smith MS GISP
State GIS Manager, Maine Office of GIS
State of Maine, Office of Information Technology
michael.smith _at_ maine.gov 207-215-5530
From: mapserver-users-bounces at lists.osgeo.org<mailto:mapserver-users-bounces at lists.osgeo.org> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Brian Fischer
Sent: Friday, November 01, 2013 2:41 PM
To: mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
Subject: [mapserver-users] WMS Server and Custom ESPG code


I am trying to use MapServer 6.2.1 as a WMS server with a custom projection and espg code, but I keep getting this error message.  msWMSLoadGetMapParams(): WMS server error. Invalid SRS given : SRS must be valid for all requested layers.

Is this supported?  I have followed these steps.

1)      Defined the custom projection with a new espg code in \ms4w\proj\nad\epsg

2)      In the mapfile, I added the reference to the Proj (CONFIG "PROJ_LIB" "E:/ms4w/proj/nad")

3)      Defined the new espg in the Web, Projection, Layer objects of the mapfile.

4)      Verified the mapfile works using the shp2img utility

Has anyone else go this to work?
Thanks!
Brian
No virus found in this message.
Checked by AVG - www.avg.com<http://www.avg.com>
Version: 2014.0.4158 / Virus Database: 3615/6797 - Release Date: 10/31/13


More information about the mapserver-users mailing list