On Sun, Jun 24, 2012 at 7:07 PM, <[email protected]> wrote:

> **
> Unfortunately, that's not the behavior I'm seeing.   I create my fill
> function like so:
>
>         Fill fill = styleFactory.createFill(
>                 newColor,                      // function to choose
> feature colour
>                 filterFactory.literal(1.0f));  // opacity
> where newColor is my external function.  When I use
> JMapFrame.showMap(map);   to show the map, it makes exactly one call to
> newColor.evaluate(Object), where the parameter  is a SimpleFeatureImpl
> object containing only the geometry.   My evaluate function looks like this:
>
>    @Override
>     public Object evaluate(Object object) {
>         return Color.GREEN;
>     }
> Unless the calling routine is "sensing" that I am returning a constant,
> there is no reason that this should only be called once for a map with
> 18,000 features.
>

It is actually sensing that, since you have no parameters in your function
the assumption is that the result will be
the same for all features, and thus the evaluation is performed just once
and your function turned into a literal.
If you function has not parameter depending on feature attributes but it
still returns varying output you should
make it implement the "VolatileFunction" interface (which, as of today,
only the random function implements)

Cheers
Andrea


-- 
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313
mob:    +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to