Symbolizing polygons
Stephan Dunning
SDunning at nephrology.org
Tue Dec 19 13:08:13 PST 2000
>Doug wrote:
>I wish to serve a map which, for example sake, will illustrate
>several classes of polygon as red, yellow, and green (for example
>sake) creating a choropleth map based on an attribute in the
>associated table.
>
>Can someone point me to a nice example where this is done so I
>can see what the map file would look like? I believe I will need
>to regenerate the map file when the attributes change, yes?
"Nice" may be a strong word :), but here's an example of something I had
originally put together:
http://mapserver.geog.umn.edu/cgi-bin/mapserv?map=/home/stephan/public_html/
hsa.map&layer=prevrate
Here too is a sample from my original mapfile with the first of 18 layers.
The layer names the Classitem, then uses the Expression line to associate a
classitem value with a RGB color.
The the Class "Name" populates the legend labels.
MAP
NAME "hsa"
EXTENT -1700000 3000000 3100000 5500000
SIZE 550 400
SHAPEPATH "data"
UNITS meters
IMAGECOLOR 230 220 190
WEB
IMAGEPATH "/pkg/mapserver_web_root/htdocs/tmp/"
IMAGEURL "/tmp/"
TEMPLATE hsa.html
END
SCALEBAR
STATUS ON
IMAGECOLOR 230 220 190
INTERVALS 4
SIZE 200 2
COLOR 0 0 0
OUTLINECOLOR 0 0 0
BACKGROUNDCOLOR 255 255 255
UNITS kilometers
LABEL
COLOR 0 0 0
SIZE small
END
END
QUERYMAP
STATUS ON
SIZE 300 200
STYLE HILITE
END
REFERENCE
STATUS ON
IMAGE graphics/hsa1.gif
SIZE 250 151
EXTENT -1700000 2700000 3100000 5800000
COLOR -1 -1 -1
OUTLINECOLOR 0 0 200
END
LEGEND
STATUS ON
IMAGECOLOR 230 220 190
LABEL
COLOR 0 0 0
END
END
LAYER
NAME prevrate
DATA hsaprev2
STATUS OFF
TYPE POLYGON
DESCRIPTION "1998 Prevalent Population (As a % of Total Population)"
CLASSITEM "Qprev"
CLASS
EXPRESSION "5"
OUTLINECOLOR 0 0 0
COLOR 0 0 185
NAME "0.1222 +"
END
CLASS
EXPRESSION "4"
OUTLINECOLOR 0 0 0
COLOR 41 41 255
NAME "0.101-0.1222"
END
CLASS
EXPRESSION "3"
OUTLINECOLOR 0 0 0
COLOR 99 99 255
NAME "0.0872-0.101"
END
CLASS
EXPRESSION "2"
OUTLINECOLOR 0 0 0
COLOR 175 175 255
NAME "0.0718-0.0872"
END
CLASS
EXPRESSION "1"
OUTLINECOLOR 0 0 0
COLOR 225 225 255
NAME "below 0.0718"
END
CLASS
EXPRESSION "0"
OUTLINECOLOR 0 0 0
COLOR 255 255 255
NAME "Insuff. Data"
END
QUERY
TEMPLATE "hsainfo.html"
END
END
END
Hope this helps!
Stephan
-----Original Message-----
From: Doug Nebert [mailto:ddnebert at fgdc.gov]
Sent: Tuesday, December 19, 2000 12:45 PM
To: Mapserver Users
Subject: Symbolizing polygons
I wish to serve a map which, for example sake, will illustrate
several classes of polygon as red, yellow, and green (for example
sake) creating a choropleth map based on an attribute in the
associated table.
Can someone point me to a nice example where this is done so I
can see what the map file would look like? I believe I will need
to regenerate the map file when the attributes change, yes?
Doug.
--
Douglas D. Nebert
Geospatial Data Clearinghouse Coordinator
FGDC/GSDI Secretariat Phone: +1 703 648 4151 Fax: +1 703 648-5755
Pager Messaging: http://clearinghouse3.fgdc.gov/dougmsg.html
More information about the MapServer-users
mailing list