Wishing we had COLORRAMPs or something
Stephen Woodbridge
woodbri at SWOODBRIDGE.COM
Fri Aug 19 10:27:30 EDT 2005
Hi Pierre,
I was not working on this code, but I too need this capability. I have
put together a thematic mapping demo at
http://imaptools.com/~woodbri/thematic/thematic.cgi
http://imaptools.com/~woodbri/thematic/thematic.cgi?name=ThemeMap&cmd=Map&debug=&location=MA&method=kmeans&numclasses=10&demographic=DP40063
but is suffers because some of these features are not present in mapserver.
-Steve W.
Pierre Racine wrote:
> Stephen,
>
> This is EXACTLY what I would need right now. This would help making
> MapServer a much better cartographic product, event better than ArcMap. It
> is harrassing to define so many CLASSes right now, mostly when we want to
> assign SIZE and COLOR to a symbol. A COLORRAMP would do the job perfectly.
>
> Is this going to be available soon?
>
> We also need to fix bug #1398 to allow SIZEITEM to control the size of
> point data type. It would be great to allow the construction of SIZEBREAK
> similar to what you described for COLORRAMP.
> To define COLORRAMP we would have:
>
> COLORRANGE 0 0 0 255 255 0 255 0 0 #black to yellow to red
> UNDERCOLOR 0 255 0 #green
> OVERCOLOR 0 0 255 #blue
> DATARANGE 0.0 100.0 #with this range, -10..0 would be mapped to green,
> 0.0001 to black, 50.0 to yellow, 100.0 to red and 100.0001... to blue
> RANGEITEM "foobar"
>
> Or
>
> COLORBREAK 0 0 0 255 255 0 255 0 0 #black to yellow to red
> UNDERCOLOR 0 255 0 #green
> OVERCOLOR 0 0 255 #blue
> DATABREAK 0.0 30.0 90.0 100.0 #instead of DATARANGE. The number of
> break-1 must match the number of COLORBREAK. x<=0.0 = green, x<=30.0 =
> black, x<=90.0 = yellow, x<=100.0 = red and x>100.0 = blue
> RANGEITEM "foobar"
>
> In this last example we could use COLORRANGE instead of COLORBREAK. This
> would imply that the values between 0.0 and 30.0 would be mapped to a color
> between black and yellow. This makes clear the difference betweem using a
> RANGE and a BREAK. A range implies interpolation and a BREAK implies exact
> color. In this case the number of color must match the number of breaks.
> Example:
>
> COLORRANGE 0 0 0 255 255 0 255 0 0 0 255 255 #black to yellow to red
> to cyan
> UNDERCOLOR 0 255 0 #green
> OVERCOLOR 0 0 255 #blue
> DATABREAK 0.0 30.0 90.0 100.0 #The number of break must match the
> number of color in COLORRANGE. x<=0.0 = green, x<=30.0 = interpolation
> between black and yellow, x<=90.0 = interpolation between yellow and blue,
> x<=100.0 = interpolation between red and cyan, x>100.0 = blue
> RANGEITEM "foobar"
>
> ________________________________________________
> Similarly for SIZE we would have something like:
>
> SIZERANGE 1 100
> UNDERSIZE 1 #omitting this parameter would default undersized value to
> the first value of SIZERANGE
> OVERSIZE 100 #idem to the last value
> DATARANGE 0.0 1456.0 #this would keep the determination of symbology in
> the map file instead of having to compute a value for SIZEITEM in Postgres
> for example. (which is the data side. "Keep data and their representation
> separated")
> SIZEITEM "foobar"
>
> Or with breaks:
>
> SIZEBREAK 1 10 100
> UNDERSIZE 0
> OVERSIZE 100
> DATABREAK 0.0 300.0 900.0 1456.0 #instead of DATARANGE. The number of
> break-1 must match the number of SIZEBREAKs. x<=0.0 = 0, x<=30.0 = 1,
> x<=90.0 = 10, x<=100.0 = 100 and x>100.0 = 100
> SIZEITEM "foobar"
>
> Or
>
> SIZERANGE 1 10 20 100
> UNDERSIZE 0
> OVERSIZE 100
> DATABREAK 0.0 300.0 900.0 1456.0 #instead of DATARANGE. The number of
> break must match the number of SIZEBREAKs. Value 150.0 is mapped to 4.5,
> value 900 to 20, etc...
> SIZEITEM "foobar"
>
> It is important to make the distinction between RANGEs and BREAKs.
>
> Pierre Racine
>
More information about the mapserver-dev
mailing list