WMS client/Terraserver example...
John Cole
john.cole at UAI.COM
Thu Aug 18 14:43:17 PDT 2005
After getting the NEXRAD data projected and working
(http://mesonet.agron.iastate.edu/docs/radmapserver/howto.html) I wanted to
get back to terraserver data.
I created a very simple map file and put all of the layer statements that I
could find from the mailing list for using terraserver wms. My problem is
that all I get is a map with my county on it, but I think my problem is that
I'm behind a proxy server. Is there a way to configure the wms client to
use a proxy server?
I would appreciate someone looking at my map file and seeing if it does
indeed work or let me know what isn't correct.
Attached is a zip file renamed to zix of my small terraserver test project
If that doesn't make it through, here is my map file and the html template.
Thanks,
John Cole
#-------------------------- main.map --------------------
MAP
# Start of Mapfile (radmapserver.map)
NAME radmapserver
STATUS ON
SIZE 800 600
#SIZE 150 96
EXTENT -86.790056 34.475633 -86.255771 34.992296
UNITS dd
IMAGETYPE PNG
# the shape path is the .map file directory
SHAPEPATH "."
# fonts.txt for windows XP (strip # sign)
# ----- cut below this line --------
# arial C:\WINDOWS\Fonts\arial.ttf
# ----- cut above this line --------
FONTSET "fonts.txt"
# Map projection definition
PROJECTION
"init=epsg:4326"
END
WEB
TEMPLATE 'main.html' # template file
IMAGEPATH "/tmp/ms_tmp/" # web server needs read/write to
this directory
IMAGEURL "/ms_tmp/" # web path to the above
directory (set this in IIS or Apache)
LOG "test_terra.log"
END
LEGEND
STATUS ON
IMAGECOLOR 255 255 255
POSITION UL
KEYSIZE 20 10
KEYSPACING 5 2
LABEL
TYPE truetype
FONT arial
size 8
OFFSET 0 0
PARTIALS TRUE
ANTIALIAS TRUE
MINDISTANCE -1
MINFEATURESIZE -1
COLOR 0 0 0
END
END
#
# Start of scalebar
#
SCALEBAR
IMAGECOLOR 255 255 255
LABEL
COLOR 0 0 0
SIZE TINY
END
STYLE 0
SIZE 200 4
COLOR 0 0 0
BACKGROUNDCOLOR 255 255 255
UNITS MILES
INTERVALS 5
STATUS on
END
# to make a reference image, set the size to 150 96 and
# uncomment the fill color line in the county style (and comment the outline
color)
# save the image as reference.png in the directory your mapfile is in
# if you do not have a reference.png set the status to OFF
REFERENCE
STATUS ON
IMAGE reference.png
EXTENT -86.790056 34.475633 -86.255771 34.992296
SIZE 150 96
MINBOXSIZE 5
MAXBOXSIZE 140
COLOR -1 0 0
OUTLINECOLOR 255 0 0
END
OUTPUTFORMAT
NAME "png"
MIMETYPE "image/png"
DRIVER "GD/PNG"
EXTENSION "png"
IMAGEMODE PC256
TRANSPARENT FALSE
FORMATOPTION "INTERLACE=ON"
END
LAYER
NAME "photo"
STATUS ON
TYPE RASTER
MINSCALE 10000
CONNECTIONTYPE WMS
CONNECTION "http://terraservice.net/OgcMap.ashx?"
METADATA
"wms_srs" "EPSG:26910"
"wms_title" "Orthophoto"
"wms_name" "DOQ"
"wms_server_version" "1.1.1"
"wms_format" "image/png"
"wms_layers" "doq"
"wms_group_title" "background"
END
PROJECTION
"init=epsg:26910"
END
END
LAYER
NAME "aerial"
TYPE RASTER
STATUS ON
CONNECTIONTYPE WMS
CONNECTION
"http://terraservice.net/ogcmap.ashx?VERSION=1.1.1&SERVICE=wms&LAYERS=urbana
rea&FORMAT=image/jpeg&STYLES="
METADATA
"wms_srs" "EPSG:4326"
END
PROJECTION
"init=epsg:4326"
END
END
LAYER
NAME ortho
METADATA
"wms_title" "USGS Digital Ortho-Quadrangles"
"wms_srs" "EPSG:4326"
LYRNAME "DOQs (orthophotos)"
LINK
"http://terraserver.microsoft.com/about.aspx?n=AboutTerraServiceOverview"
END
GROUP "BASE DATA"
STATUS ON
DEBUG ON
TYPE RASTER
MINSCALE 1500
MAXSCALE 80000
CONNECTIONTYPE WMS
CONNECTION
"http://terraservice.net/ogcmap.ashx?VERSION=1.1.1&SERVICE=wms&LAYERS=DOQ&FO
RMAT=png&styles="
PROJECTION
"init=epsg:4326"
END
END
LAYER
NAME DOQ17N
METADATA
"wms_title" "USGS Digital Ortho-Quadrangles"
#"wms_srs" "EPSG:26916" #NAD83 UTM zone 16N
"wms_srs" "EPSG:4326"
LYRNAME "DOQs (orthophotos)"
LINK
"http://terraserver.microsoft.com/about.aspx?n=AboutTerraServiceOverview"
END
STATUS default
TYPE RASTER
CONNECTIONTYPE WMS
CONNECTION
"http://terraservice.net/ogcmap.ashx?VERSION=1.1.1&SERVICE=wms&LAYERS=DOQ&FO
RMAT=png&styles="
PROJECTION
#"init=epsg:26916" #NAD83 UTM zone 16N
"init=epsg:4326"
END
END
# Madison County, Alabama TIGER County 2000 polygon
# http://arcdata.esri.com/data/tiger2000/tiger_download.cfm
LAYER
NAME "Madison County"
DATA "tgr01089cty00"
METADATA
"wms_title" "Madison County"
"wms_srs" "EPSG:4326"
END
PROJECTION
"init=epsg:4326"
END
STATUS default
TYPE POLYGON
CLASS
NAME "Madison County"
STYLE
OUTLINECOLOR 0 255 0
#COLOR 242 236 223
END
END
END
END
#-------------------------- main.map --------------------
<!-- --------------------------- main.html --------------------------------
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content=
"HTML Tidy for Windows (vers 1st June 2004), see www.w3.org" />
<title>MapServer Workshop</title>
<meta http-equiv="Content-Type" content=
"text/html; charset=us-ascii" />
<link type="text/css" rel="stylesheet" href=
"/projects/tutorial/ms35.css" />
</head>
<body bgcolor="#FFFFFF" text="#000000">
<h3>Terraserver Sample Map View</h3>
<!-- START OF MAPSERVER FORM -->
<!-- you will need to set the action to point to where your mapserver
executable is -->
<form name="mapserv" method="get" action="/cgi-bin2/mapserv.exe"
id="mapserv">
<!-- HIDDEN MAPSERVER CGI VARIABLES -->
<input type="hidden" name="map" value="[map]" />
<input type="hidden" name="imgext" value="[mapext]" />
<input type="hidden" name="imgxy" value="199.5 149.5" />
<input type="hidden" name="layers" value="[layers]" />
<table width="400" border="1">
<tr>
<td>
<!-- SPECIFY MAP MODE -->
<div align="center">
Map Mode:<br />
<select name="mode">
<option value="browse">
Browse
</option>
<option value="map">
Map
</option>
</select>
</div>
</td>
<td>
<!-- FORM SUBMIT BUTTON -->
<div align="center">
<input type="submit" name="submit" value="Refresh" />
</div>
</td>
<td>
<!-- ZOOM/PAN CONTROLS -->
<div align="center">
Map Control:<br />
<select name="zoom">
<option value="4" [zoom_4_select]>
Zoom In 4x
</option>
<option value="3" [zoom_3_select]>
Zoom In 3x
</option>
<option value="2" [zoom_2_select]>
Zoom In 2x
</option>
<option value="1" [zoom_1_select]>
Recenter
</option>
<option value="-2" [zoom_-2_select]>
Zoom Out 2x
</option>
<option value="-3" [zoom_-3_select]>
Zoom Out 3x
</option>
<option value="-4" [zoom_-4_select]>
Zoom Out 4x
</option>
</select>
</div>
</td>
<td rowspan="2" valign="top">
<p>Reference:<br />
<img name="ref" src="[ref]" id="ref" /></p>
<p>Legend:<br />
<img name="legend" src="[legend]" id="legend" /></p>
</td>
</tr>
<tr>
<!-- DISPLAY THE MAPSERVER-CREATED MAP IMAGE -->
<td colspan="3" align="center" valign="top">
<input type="image" name="img" src="[img]" width="800"
height="600" border="0" />
<table border="0" width="600" align="center">
<!-- DISPLAY THE SCALE BAR -->
<tr>
<td align="right"><img src="[scalebar]" /></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<p>Map scale 1:[scale]</p>
<p>Pixel size [cellsize]</p>
<p>Extents [minx], [miny], [maxx], [maxy]</p>
<p>Map size (screen) [mapsize]</p>
<p>Map width [mapwidth]</p>
<p>Map height [mapheight]</p>
<p>Map [map]</p>
<p>Layers [layers]</p>
</body>
</html>
<!-- --------------------------- main.html --------------------------------
-->
-------------------------------------
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: terraserver.zix
Type: application/octet-stream
Size: 24636 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050818/a0353ec9/attachment.obj>
More information about the MapServer-users
mailing list