[mapserver-users] Simple MrSid map file

Brent Fraser bfraser at geoanalytic.com
Tue Feb 12 14:01:57 EST 2008


Ken,

 I've CC'd my response to the Mapserver list as there are
lots of smart and helpful people out there (I edited your
URLs to remove the IP address so your site won't get 500
hits as everyone rushes to solve your problem :)  )

    Basically you need to know the coordinate system of your
input data (I think it is UTM zone 14 NAD83, so EPSG 26914,
not 4269), and your desired output coordinate system (EPSG
4269 is ok, it's Geographic (AKA lat/lon, un-projected,...)
so it may not be what you'd expect).

  Some WMS client applications prefer Geographic and do the
re-projection to a Cartesian coordinate system themselves
after they've received the map image from the server.
Others let the users pick the coordinate system from the
list supplied by the WMS server and let the server
re-project and supply the image in the user-selected
coordinate system.

  If you need a stand-alone WMS client, try Quantum GIS.  If
you plan on constructing a web front-end to Mapserver, have
a look at Open Layers.

  Other comments inserted below...

Brent Fraser
GeoAnalytic Inc.
Calgary, Alberta

----- Original Message ----- 
From: "Ken S. Elvehjem" <elvehjem at runestone.net>
To: "Brent Fraser" <bfraser at geoanalytic.com>
Sent: Tuesday, February 12, 2008 11:06 AM
Subject: Re: [mapserver-users] Simple MrSid map file


> Brent,
>
> My goal is to be able to query the raster data that I have
stored.
> Apparently it's required to take the next step:  Create a
WMS...
>
> So I did. According to the directions, a wms is just a
glorified mapfile,
> with some certain elements required.  I am reasonably sure
I have my *epsg*
> numbers wrong, but the examples showed so many I couldn't
figger out which
> was which.  My data is all within UTMZ 14 for McCook Co
SD.
>
> I'd appreciate any comments -- even rude ones -- that
you'd care to make!
>
> Sincerely,
>
> Ken
>
> My mapfile looks like this:
>
> MAP
>   NAME MCCOOK
>   STATUS ON
>
>   IMAGETYPE PNG
>   SIZE 600 600
>
> # Projection - same as input data (UTM Zone 15, NAD83),
> #              so no need to have MapServer re-project
>   PROJECTION
>    "init=epsg:4269"
>   END
>
>   UNITS METERS
> #        [minx] [miny]  [maxx] [maxy] in meters
>   EXTENT 610471 4810318 651740 4859698
>
>
#---------------------------------------------------------
>   WEB
>  TEMPLATE "mccook.html"
>  IMAGEPATH "C:\ms4w\Apache\htdocs\tmp/"
>  IMAGEURL "/tmp/"
>
>    METADATA
>      "wms_title"           "WMS McCOOK"
>          "wms_onlineresource"
"http://myserver/cgi-bin/mapserv?"
> # map=c:\ms4w\Apache\htdocs\SD\mccook\mccook-wms.map&"
>        "wms_srs"             "EPSG:4269 EPSG:4326"
>  END
>
>
>   END
>
>
#---------------------------------------------------------
>   LAYER
>     NAME NAIP2006
>     TYPE RASTER
>     STATUS DEFAULT
>     DATA "mccook2006.sid"
>
>  PROJECTION
>            "init=epsg:4269"
>  END
>
>    METADATA
>      "wms_title"           "WMS McCOOK"
>          "wms_onlineresource"
"http://myserver/cgi-bin/mapserv?"
> # map=c:\ms4w\Apache\htdocs\SD\mccook\mccook-wms.map&"
>        "wms_srs"             "EPSG:4269 EPSG:4326"
>  END
>
>   END
>
> END # Map File
>
>
> The following URL:
>
http://myserver/cgi-bin/mapserv.exe?map=c:\ms4w\Apache\htdocs\SD\mccook\mccook-wms.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities
> returns the following:  (returns as mapserv.exe... I had
to save it, looked
> at it w/ my hex editor and decided it was *not* an exe.-- 
renamed it and
> viewed with text editor)


You need to use a WMS client to issue the URL (and
interprete the results).  And I think you may need to do
some minor configuring of Apache to send the right
Content-type (text-html).  The Mapserver Apache experts
would know more...


>
> <?xml version='1.0' encoding="ISO-8859-1" standalone="no"
?>
> <!DOCTYPE WMT_MS_Capabilities SYSTEM
 :
 :
</Capability>
> </WMT_MS_Capabilities>


It's a valid capabilities document and will be understood by
a WMS client (I think).


Brent



More information about the mapserver-users mailing list