I kind of expect a difference; you are accessing an attribute. If you have a 
simple style often the rendering system does not request any attributes (only 
geometry). For something like a shapefile this can make a massive difference!

The other alternative is to use a function to set your draw color; and the 
function can reference the LINE_ID and map LINE_ID to Colour.

There is a Recode function or something that performs this way; indeed the 
performance of this function was recently a subject of discussion. 
- 
http://docs.geotools.org/latest/javadocs/org/geotools/filter/visitor/Recode.html

There are also some functions specifically for making nice styles - try using 
the following for smooth color shifts:
- 
http://docs.geotools.org/latest/javadocs/org/geotools/filter/function/InterpolateFunction.html

There are some examples here:
- 
http://docs.geotools.org/latest/userguide/library/main/filter.html#variable-arguments
-- 
Jody Garnett


On Wednesday, 6 July 2011 at 6:08 PM, LSA wrote:

> I am thinking about implementing single Rule, which will return 
> different color depending on feature that is being processed.
> Is this possible?
> 
> Sergey
> 
> On 06.07.2011 14:51, LSA wrote:
> > Hi,
> > 
> > What are best practices to maximize geotools rendering performance?
> > 
> > Layer contains 25000 features
> > 
> > With simple style - rendering tooks<0.5 sec.
> > 
> > With style like:
> > [[ Line_ID>= 2.0 ] AND [ Line_ID< 11.2 ]] -> draw with color1
> > [[ Line_ID>= 11.2 ] AND [ Line_ID< 20.4 ]] -> draw with color2
> > [[ Line_ID>= 20.4 ] AND [ Line_ID< 29.6 ]] -> draw with color3
> > [[ Line_ID>= 29.6 ] AND [ Line_ID< 38.8 ]] -> draw with color4
> > [[ Line_ID>= 38.8 ] AND [ Line_ID< 47.9 ]] -> draw with color5
> > [[ Line_ID>= 47.9 ] AND [ Line_ID< 57.1 ]] -> draw with color6
> > [[ Line_ID>= 57.1 ] AND [ Line_ID< 66.3 ]] -> draw with color7
> > [[ Line_ID>= 66.3 ] AND [ Line_ID< 75.5 ]] -> draw with color8
> > [[ Line_ID>= 75.5 ] AND [ Line_ID< 84.7 ]] -> draw with color9
> > [[ Line_ID>= 84.7 ] AND [ Line_ID< 93.9 ]] -> draw with color10
> > [[ Line_ID>= 93.9 ] AND [ Line_ID< 103.1 ]] -> draw with color11
> > [[ Line_ID>= 103.1 ] AND [ Line_ID< 112.3 ]] -> draw with color12
> > [[ Line_ID>= 112.3 ] AND [ Line_ID< 121.5 ]] -> draw with color13
> > [[ Line_ID>= 121.5 ] AND [ Line_ID< 130.7 ]] -> draw with color14
> > [[ Line_ID>= 130.7 ] AND [ Line_ID< 139.9 ]] -> draw with color15
> > [[ Line_ID>= 139.9 ] AND [ Line_ID< 149.1 ]] -> draw with color16
> > [[ Line_ID>= 149.1 ] AND [ Line_ID< 158.3 ]] -> draw with color17
> > [[ Line_ID>= 158.3 ] AND [ Line_ID< 167.5 ]] -> draw with color18
> > [[ Line_ID>= 167.5 ] AND [ Line_ID< 176.7 ]] -> draw with color19
> > [[ Line_ID>= 176.7 ] AND [ Line_ID<= 185.0 ]] -> draw with color20
> > 
> > its performance really poor - it tooks 3 sec to render (which about six
> > time slower).
> > 
> > Sergey
> > 
> > ------------------------------------------------------------------------------
> > All of the data generated in your IT infrastructure is seriously valuable.
> > Why? It contains a definitive record of application performance, security
> > threats, fraudulent activity, and more. Splunk takes this data and makes
> > sense of it. IT sense. And common sense.
> > http://p.sf.net/sfu/splunk-d2d-c2
> > _______________________________________________
> > Geotools-gt2-users mailing list
> > [email protected] 
> > (mailto:[email protected])
> > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> > 
> 
> 
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security 
> threats, fraudulent activity, and more. Splunk takes this data and makes 
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected] 
> (mailto:[email protected])
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to