Proof of Concept Gradient Coloring and Dev question

Bart van den Eijnden BEN at SYNCERA-ITSOLUTIONS.NL
Tue Apr 5 02:57:31 PDT 2005


Hi Bill,

Frank Warmerdam had this functionality (color-ramp) on his wishlist so you may want to check with him for ideas.

General procedure would be opening up a bugzilla entry and add the patch as an attachment, and then send out a short e-mail to the mapserver-dev list with a link to the bug report. The bugzilla entry can then also be used to discuss the final implementation.

There is a Mapserver CVS, although only the (core) developers have CVS write access. So probably one of the developers with CVS write access should apply your patch/feature (after they agree with the implementation ofcourse).

Best regards,
Bart

Met vriendelijke groet,

Bart van den Eijnden
GIS specialist
Syncera IT-Solutions

>>> Bill Binko <bill at BINKO.NET> 04/04/05 11:27pm >>>
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



More information about the MapServer-users mailing list