[mapserver-users] WMS Server and Custom ESPG code
Basques, Bob (CI-StPaul)
bob.basques at ci.stpaul.mn.us
Fri Nov 1 14:52:48 PDT 2013
Well, in order to rule out the reading of the proj file you could put the whole projection block right into the Mapfile, similar to . . .
PROJECTION
"proj=utm"
"ellps=GRS80"
"datum=NAD83"
"zone=15"
"units=m"
"north"
"no_defs"
END
Bobb
From: 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 4:47 PM
To: Donald Kerr; 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20131101/c2d1de7b/attachment.htm>
More information about the MapServer-users
mailing list