Wishing we had COLORRAMPs or something

Bill Binko bill at BINKO.NET
Tue Jun 28 21:49:16 EDT 2005


> 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