I tried this really simple example to color the map based on the
hashcode of the geometry. But it seems to be drawing all the shapes
with a single color on every refresh. What am I doing wrong here ?
public ColorRampFunction(List<Color> fillColors) {
super("colorramp");
fillColors_.addAll(fillColors);
propertyName_ = filterFactory_.property("the_geom");
}
public Object evaluate(Object feature) {
Object id = propertyName_.evaluate(feature);
logger_.debug("Hash code {}", id.hashCode());
int index = (int)(((long)Integer.MAX_VALUE +
(long)id.hashCode()) % fillColors_.size());
logger_.debug("Index {}", index);
return fillColors_.get(index);
}
On Fri, May 21, 2010 at 10:14 PM, Michael Bedward
<[email protected]> wrote:
> On 22 May 2010 01:23, Ian Turton wrote:
>>
>> I have a paper on how to create the adjacency graph
>> (http://www.citeulike.org/group/9502/article/6600150) that is on my to
>> do list (but quite low down it :-) I can mail a copy of the PDF to
>> anyone who's interested.
>>
>
> Thanks Ian - that's an interesting paper !
>
> Michael
>
> ps. also reminds me to tell folks again about the GeoTools CiteULike group
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
------------------------------------------------------------------------------
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users