Map Viewer Technical Details
See also:
About the Map Viewer and
Frequently Asked Questions.
The Map Viewer
is implemented as as a
perl
script that accepts requests for map renderings and returns an
HTML
document including an inlined GIF image of the requested map.
It is running as part of a custom inetd-invoked
HTTP
daemon running on the host mapweb.parc.xerox.com at the Xerox Palo Alto Research Center in California.
The map images are generated on the fly by the
mapwriter program
which is a stand-alone Unix command which produces raster map images
from either of two publically available vector map databases. Options
controlling the map renderings are encoded into the W3
URL
strings and passed as command line arguments to the mapwriter program.
Efficient conversion to GIF format is provided by a program called rastogif contributed by James Woods (jaws@dme.nt.gov.au).
A small static cache is used for a few of the most frequently requested map images.
For a list of the colors used for various map features, see
World Map Legend
and U.S.A. Map Legend.
URL Format
Map rendering options are encoded into the URL by separating each
option with a slash (/) and within each option separating the option
name from its value by an equals (=). Thus the URLs take the form:
http://hostname/map/option=value/.../option=value
The following map rendering options are currently recognized by the Map Viewer server.
- /db=database_name
- the database name, either world or usa
- /lat=latitude_center
- the center latitude for the map in degrees (negative for south, default 0)
- /lon=longitude_center
- the center longitude for the map in degrees (negative for west, default 0)
- /ht=latitude_extent
- the height of the map in degrees (default 180)
- /wd=longitude_extent
- the width of the map in degrees (default 360)
- /iwd=image_width
- the width of the map image in pixels (default 512)
- /iht=image_height
- the height of the map image in pixels (default 256)
- /color
- generate color raster images
- /bw
- generate monochrome bitmaps (default)
- /noview
- do not show the map as an inlined image (speeds up changing options)
- /view
- show the map as an inlined image (default)
- /nozoom
- do not zoom in on position selections
- /autozoom=zoom_factor
- change the zoom factor for position selections
- /all
- show all map featues
- /def
- show default map featues
- /feature_name
- show the named feature (e.g. coast, border, river, road, RR, fed.)
- /feature_name=0
- do not show the named feature
- /nogrid
- do not show the map graticule (lines of latitude/longetude)
- /grid
- show the graticule unless zoomed very far in (default)
- /mark=latitude,longitude,mark_type,mark_size
- place a mark on the map.
",mark_type" (1..7) and ",mark_size" (in pixels) are optional.
multiple marks can be separated by ";" (see example below).
- ?xpos,ypos
- specifies a position selection within a map image in pixel coordinates
(generated from ISMAP inlined images).
This must occur last in the URL.
- /format=.gif
- used when requesting just an image, rather than an HTML document.
This must occur last in the URL.
If the same option occurs more than once, the last setting prevails.
Options may also be specified in a search query field (i.e. following
a "?" in the URL) separated by "/" or "+" (i.e. spaces in the user's
query). See the example below.
- /map
- Produces the default world map image in a hypertext document.
- /map/format=.gif
- Produces just the GIF image (displayed in a separate viewer in Mosaic).
- /map/db=usa/color/ht=1/wd=2/lat=37.8/lon=-122
- A map of the San Francisco Bay Area.
- /map/db=usa/color/ht=1/wd=2/lat=37.8/lon=-122?ht=.5+wd=1
- The same map with the map scale overridden from the search query field.
- /map/lat=-40.60/lon=-172.35/ht=15/wd=12/iht=150/iwd=128
- A small map of New Zealand.
- /map/color/mark=37.40,-122.14;21.35,-157.97
- Specifies marks for Palo Alto, California and Pearl Harbor, Hawaii.
- A scrambled image results for values of iwd that are not a multiple of 8 (e.g. iwd=100). The server has been patched to round up widths.
- The "Requested region" reported will be smaller than the displayed region if the image aspect ratio does not match the latitude/longitude extent (in degrees).
- Meridian lines are displayed relative to the center longitude of the current map, rather than at standard multiples of degrees.
- This interface does not take advantage of the HTML/HTTP extensions
for fill-in-the-blank forms.
Please send questions or comments to
webmaster@xerox.com.
02-Jun-95