US Census Bureau

TIGER Mapping Service
The "Coast to Coast" Digital Map Database.


Direct Map Request

The Tiger Mapping Service has been designed around an open architecture for maximum flexibility. The TMS Map Browser is not the only way of accessing TMS-generated maps; it is only an example application. By using the syntax below, anyone can request maps directly via a URL. This makes it possible to include TMS maps in your own documents, or even your own interactive mapping applications, because a "live" TMS map addressed using the URL described below can be used in exactly the same manner as a static GIF image (i.e., in a <IMG> element).

syntax

Basically, a map can be requested directly from TMS by using the following URL:
http://tiger.census.gov/cgi-bin/mapgen?parameter&parameter&...
where the parameters can be any or all of the following, separated by ampersands:
lon=number
the longitude, in decimal degrees, of the center of the map. Remember that longitudes for the Western Hemisphere are negative numbers. Longitudes for the contiguous U.S. range between about -67 and -125 degrees.
lat=number
the latitude, in decimal degrees, of the center of the map. Latitudes for the contiguous U.S. range between about 24 and 49 degrees.
wid=number
the desired width, in decimal degrees of longitude, of the coverage of the map. The actual coverage of the map may vary slightly from this number, due to fitting the requested coverage to the shape of the image.
ht=number
the desired height, in decimal degrees of latitude, of the coverage of the map. May turn out slightly different, for the reason above.
iwd=number
the image width, in pixels. If none is specified, the default is 512.
iht=number
the image height, in pixels. If none is specified, the default is 256.
legend=on
if included, the legend graphic is returned rather than the map.
mark=lon,lat,symbol,label;...
if included, places one or more markers on the map at the longitude and latitude given. The label, if included, is the text to be displayed adjacent to the marker (the label must by URL-encoded, i.e., replacing spaces with +). The symbol is the graphic symbol used to mark the location. Currently, the following symbols are supported:
  • smalldot (default if none specified), bigdot, home
  • redstar, bluestar, cross
  • interstate-1, ushwy-1, statehwy-1
  • interstate-3, ushwy-3, statehwy-3
  • redpin grnpin blupin, orgpin, purpin, magpin, brnpin lgrpin, cynpin, grypin, whtpin,
  • redball grnball, blueball,
  • reddot10 grndot10, bludot10, orgdot10, purdot10, magdot10, brndot10, lgrdot10, cyndot10, grydot10, whtdot10
  • reddot7 grndot7, bludot7, orgdot7, purdot7, magdot7, brndot7, lgrdot7, cyndot7, grydot7, whtdot7
  • reddot5 grndot5, bludot5, orgdot5, purdot5, magdot5, brndot5, lgrdot5, cyndot5, grydot5, whtdot5
  • red5 green5, blue5, purple5, brown5, black5
  • red4 green4, blue4, purple4, brown4, black4
  • red3 green3, blue3, purple3, brown3, black3
  • More than one marker can be placed, by separating the marker parameters with a semicolon (;). However, the allowable number is limited by the 256-character URL limit (which amounts to about 6-8 points).
    murl=URL
    this gets over the above marker limit by allowing the requestor to submit an entire list of points. This list is placed in a separate file, which must be in a place visible to the world via HTTP (i.e., on your own web server). The URL given is the address used to retrieve this file. The format of the file is as follows:
    #tms-marker        (a flag on the first line to identify the file type)
    lon,lat:symbol:label  #optional comments after a pound sign
    lon,lat:symbol:label  #labels are optional, but you still need the colon
    lon,lat:symbol:label  #  after the symbol.
    lon,lat:symbol:label
    where lon, lat, symbol, and label are defined as above (except that the label is not URL-encoded). An example marker file might be useful.
    on=layer,layer,layer
    off=layer,layer,layer
    forces individual feature layers to be displayed, or not displayed, respectively. These fields override, but don't replace, the natural layer selection (i.e. layers not mentioned may still be displayed or not, depending on the default scheme). The following layer names are valid:
    tlevel=level
    selects a geography level for drawing thematic statistical maps (must be used with tmeth and tvar). The available level codes are:
    tvar=variable
    selects a statistical variable to use in thematic maps (must be used with tlevel and tmeth). So far, not all the 1990 census variables are in the database, but the following can be used:
    tmeth=q or i
    selects the classification method to use in thematic maps (must be used with tlevel and tvar). Can either be "q" for Quintiles (5 classes of equal size) or "i" for Equal Interval (5 classes with an even range of values). These classes are calculated over the entire country, not just the map area. Quintiles tend to provide better contrast between values around the average, while Equal Interval tends to emphasize the extremes (but this is not a hard and fast rule).
    For your information, all maps are projected using a simple sinusoidal projection centered on the central meridian. This makes the response quick, but also makes it difficult to mosaic maps together. In this projection, distances are true to scale horizontally, vertically along the central meridian, but not diagonally.

    Examples

    Here are some examples of usage for the Direct Map Request feature:
    The Mall in Washington, D.C., with markers on the White House and Capitol:
    http://tiger.census.gov/cgi-bin/mapgen/.gif?lat=38.89&lon;=-77.028&wid;=.06&ht;=.01&iht;=300&iwd;=400&mark;=-77.0364,38.8973,redpin,White+House;-77.01,38.8895,blueball,Capitol
    The 48 contiguous United States:
    http://tiger.census.gov/cgi-bin/mapgen/.gif?lat=36&lon;=-96&wid;=50&ht;=24&iht;=230&iwd;=400
    The Northeastern United States:
    http://tiger.census.gov/cgi-bin/mapgen/.gif?lat=42&lon;=-75&wid;=14&ht;=11&iht;=300&iwd;=350
    Manhattan, New York City:
    http://tiger.census.gov/cgi-bin/mapgen/.gif?lat=40.739&lon;=-73.99&wid;=0.06&ht;=0.08&iht;=500&wd;=240
    Legend for above Manhattan map:
    http://tiger.census.gov/cgi-bin/mapgen/.gif?legend=on⪫=40.739&lon;=-73.99&wid;=0.06&ht;=0.08&iht;=500&wd;=240
    A region with several cities marked:
    http://tiger.census.gov/cgi-bin/mapgen?lon=-80⪫=40&wid;=5&ht;=5&off;=CITIES&murl;=http://tiger.census.gov/tigerwww/mission2

    If you have feedback, please check out the Mapsurfer Feedback page.
    If you have questions, please check out the service FAQ page.

    [TMS] Return to home page.

    Last Revised: Friday, 12-Sep-97 13:41:45