Proof of Concept Gradient Coloring and Dev question

Havard Tveite havard.tveite at UMB.NO
Tue Apr 5 03:42:23 EDT 2005


I agree that it would be nice to have a way of rendering
quantitative attributes in UMN Mapserver semi-automatically.

What about making the functionality more "general" by for
instance including the following STYLE items:

NUMBEROFCLASSES - the number of classes used (if not speficied,
                   a "continuous" rendering is performed).
BREAKS - The method of classification - "naturalbreaks",
          "equalinterval", "histogramequal", ... or the actual
          breakpoints ("1000,5000,7000,13000,21000,26000,29000").

Håvard Tveite

Bill Binko wrote:
> Hi everyone,
>
> I have just implemented a quick hack to add gradient coloring to mapserver
> 4.4.1.  This was just an itch I was scratching, but I'd be happy to feed
> it back into the code.  My main question here is how do I do that: is
> there a CVS repository?  Do I mail in patches?  To whom?
>
> Regarding the gradient coloring, it works like this:  you choose a numeric
> field in your data (I've tested with PostGIS, but anything you can use for
> classitem or labelitem should work), and create a style like this:
>
> STYLE
>   COLOR 60 60 60
>   MINCOLOR 0 0 0
>   MAXCOLOR 255 255 0
>   MINVALUE 0.0
>   MAXVALUE 300000.0
>   GRADIENTITEM "sale_price"
> END
>
> That takes the sale_price field from the shapes values, maps its value to
> a percentage between MINVALUE and MAXVALUE and then picks the color that's
> appropriate from the color range.
>
> For a quick snapshot of how this looks, I've mapped relative size of
> parcels (as a percentage) to these colors:
>
>                 MINCOLOR 127 29 200 #Purple
>                 MAXCOLOR 255 255 0  #Yellow
>
> You can see the results here: http://www.binko.net/gradient.png
>
> As I said, this is still in the proof of concept stage, and I haven't
> tested against any rendering except GD (although in theory it should
> work).
>
> Any help on future direction and how to contribute back would be
> appreciated.
>
> Bill
>

--
Håvard Tveite
Department of Mathematical Sciences and Technology, UMB
Drøbakveien 14, POBox 5003, N-1432 Ås, NORWAY
Phone: +47 64965483 Fax: +47 64965401 http://www.umb.no/imt



More information about the mapserver-users mailing list