Wishing we had COLORRAMPs or something
Stephen Woodbridge
woodbri at SWOODBRIDGE.COM
Tue Jun 28 20:15:03 PDT 2005
Bill,
Hey, this sounds great!
I will give it a try. I knew you had done some work in this area, but I
did not realize it was in 4.6 which I am using.
What I just got working on my laptop, using postGIS and some perl code
is an app that lets me select any of large number (200+) demographic
variable and a state, then it queries the data from postgres and applies
one 4 different classification schemes to the data to generate breaks
and then requests a map and the zcta polygons are classified by
converting the attribute value into a 0 .. N class number and the
mapfile has classes to color it. I need to generate a legend to also but
probably need to do it outside of mapserver because I have already
reduced the classification to 0 .. N classes. Your ramp is just what the
I need because I can pass the numclasses as %numclasses% to the ramp.
At some point in the near future I will move the database back over to
the server then I can post a demo link.
Very Cool!
-Steve
Bill Binko wrote:
>>Why is this needed? you ask, just make a bunch of classes.
>
>
> Mwuu ha ha (*seang will kill me for this*)
>
> Take a look at bug 1305, and see if that will fit your needs.
>
> It is close, but not exactly what you want. Most obviously, legend
> support is non-existant at this point, but I could be motivated to help
> there if I ever get away from ECW and GeomUnion issues.
>
> If you're running 4.6, then support is already in there for you.
>
>
>>For a thematic map, you can select the number of breaks you want to
>>display, between 2 and 10 say. I already have code to compute the class
>>breaks and to assign them a number between 0 and numclasses, now I need
>>to a color in the ramp based on numclasses. If your ramp is RED from 0
>>to 255, and you have a 2 class ramp the 2 will be 255, but if you
>>display the same thin with a 10 class ramp 10 will be 255 and 2 will be
>>like 25.5
>>
>
>
> In this case, you'd want to do something like this:
>
> CLASS
> COLOR 0 0 0 #mapserver wants a default color
> STYLE
> COLORRANGE 0 0 0 255 0 0 #start and end colors
> DATARANGE 0 10 #start and end values
> RANGEITEM "someField" #the field to use
> END
> END
>
> No doubt this is not perfect (it has no "breaks": it is continuous).
> However, having another user try it and provide feedback (into the bug
> please) can only help.
>
> Bill
>
More information about the MapServer-users
mailing list