[mapserver-users] Simple thanks (re: Simple MrSID Map File)

Brent Fraser bfraser at geoanalytic.com
Wed Feb 13 10:49:40 EST 2008


Ken (and all),

  Thanks for the thanks :)  For those new users searching
this list sometime in the future,  below are the minimalist
steps to get mapserver to read a raster file and display it
in a browser (as Ken says, the "hello world" of web
mapping).


(0. Install ms2w and the Itasca demo dataset)

1. Make a map file using a text editor.  Call it min.map and
put it in the Workshop directory (in your web server's
document-root directory).

===========================
MAP
  NAME ITASCA

# ----- Output image properties -----
  IMAGETYPE PNG           # output type
  SIZE 600 600            # image size in pixels

# ----- Output image spatial reference system
definition -----
# Output Projection - same as input data (UTM Zone 15,
NAD83),
#              so no need to have MapServer re-project,
#              therefor no PROJECTION object required
  UNITS METERS
#         minx    miny   maxx   maxy  (in meters)
  EXTENT 423900 5205200 576000 5317000

# ----- Web interface definition -----
  WEB
    TEMPLATE "min.html"    # the html Mapserver will send to
your browser
    IMAGEPATH "C:\Inetpub\wwwroot\tmp\"   # dir where
mapserver will
    IMAGEURL                    "/tmp/"   #  create the
output image
  END

# ----- Source data definition -----
  LAYER
    NAME "drg"
    TYPE RASTER
    STATUS DEFAULT    # always "on"
    DATA "C:\Inetpub\wwwroot\workshop\data\drgncimq1942.tif"
  END

END # Map File
==============================


2. Make an html template file
The above map file relies on an html "template", stored in
the same directory as min.map, in our case named "min.html"
:
==============================
<html>
<body>
Hello World!<p>
<img src="[img]" width="[mapwidth]" height="[mapheight]" />
</body>
</html>


3. The URL you issue in your browser:
http://localhost/cgi-bin/mapserv.exe?map=c:\Inetpub\wwwroot\workshop\min.map


Brent Fraser
GeoAnalytic Inc.
Calgary, Alberta

----- Original Message ----- 
From: "Ken S. Elvehjem" <elvehjem at runestone.net>
To: <mapserver-users at lists.osgeo.org>
Sent: Wednesday, February 13, 2008 7:34 AM
Subject: [mapserver-users] Simple thanks (re: Simple MrSID
Map File)


Just a note to everyone to say how much I appreciate the
availability of this list.

A special thanks to Brent Fraser for his help... Was feeling
like I had wandered into *Looking Glass Land*... But Now...
my MrSID files are served up in a WMS server on my office
machine... and I know I couldn't have done it without his
comments, suggestions, and encouragement.

"A patch of ground in South Dakota:"
http://206.183.188.202/cgi-bin/mapserv.exe?map=c:\ms4w\Apache\htdocs\SD\mccook-wms.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=NAIP2006&STYLES=&SRS=EPSG:4269&BBOX=611300,4815500,613300,4817500&WIDTH=800&HEIGHT=800&FORMAT=image/jpeg

Sincerely,

Ken
Ken S. Elvehjem
ELVEHJEM TECHNICAL SUPPORT
250 Drury Ave
PO Box 37
Lowry MN  56349
320.283.5684
320.283.5247 h
320.424.1299 c


------------------------------------------------------------
--------------------


> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>



More information about the mapserver-users mailing list