Thank you for the prompt response, Michael!   Geotools continues to be the 
shining example of how open source gets done right.  :)

I will try these tomorrow and post the results to help others who may be 
struggling with this.

Thanks!

----- Original Message ----- 
From: "Michael Bedward" <[email protected]>
To: <[email protected]>
Cc: <[email protected]>
Sent: Thursday, June 14, 2012 8:25 PM
Subject: Re: [Geotools-gt2-users] StyleFunctionLab demo replacement?


Hello Tom,

I think this was something that I had a hand in. The demo was
discarded after it was pointed out by other developers that the
approach used was cheap, ugly and unreliable :)

In the meantime, several functions have been added to GeoTools which
might do exactly what you want. They are described, with examples, on
the following GeoServer page:

http://docs.geoserver.org/latest/en/user/styling/sld-tipstricks/transformation-func.html

Although that page shows the functions being used within SLD docs it
is also possible to apply them programmatically in your application.

Let me know if they are sufficient. If you need something more
tailored we can discuss creating a Function (and associated
FunctionFactory if required) following the general approach in this
tutorial:

http://docs.geotools.org/latest/userguide/tutorial/advanced/function.html

Michael


On 15 June 2012 12:36,  <[email protected]> wrote:
> Once upon a time there was a tutorial called StyleFunctionLab which did
> exactly what I needed to do - call out to a custom function as it iterates
> over a data set, allowing each element to be colored (or outlined or
> whatever) differently.
>
> I implemented this tutorial a year or two ago, and had it working - then I
> got called away by other things, and now I can't get the tutorial working
> again. Instead, I get this:
>
> SEVERE: Unable to find function Colour
> java.lang.RuntimeException: Unable to find function Colour
> at 
> org.geotools.filter.FunctionFinder.findFunction(FunctionFinder.java:205)
> at 
> org.geotools.filter.FunctionFinder.findFunction(FunctionFinder.java:152)
> at 
> org.geotools.filter.FunctionFinder.findFunction(FunctionFinder.java:127)
> at
> org.geotools.filter.FilterFactoryImpl.function(FilterFactoryImpl.java:723)
> at
> org.geotools.filter.visitor.DuplicatingFilterVisitor.visit(DuplicatingFilterVisitor.java:336)
> at
> org.geotools.filter.FunctionExpressionImpl.accept(FunctionExpressionImpl.java:207)
> at
> org.geotools.styling.visitor.DuplicatingStyleVisitor.copy(DuplicatingStyleVisitor.java:353)
> at
> org.geotools.styling.visitor.DuplicatingStyleVisitor.visit(DuplicatingStyleVisitor.java:606)
> at org.geotools.styling.FillImpl.accept(FillImpl.java:201)
> at
> org.geotools.styling.visitor.DuplicatingStyleVisitor.copy(DuplicatingStyleVisitor.java:384)
> at
> org.geotools.styling.visitor.DuplicatingStyleVisitor.visit(DuplicatingStyleVisitor.java:690)
> at
> org.geotools.styling.visitor.UomRescaleStyleVisitor.visit(UomRescaleStyleVisitor.java:223)
> at
> org.geotools.styling.PolygonSymbolizerImpl.accept(PolygonSymbolizerImpl.java:140)
> at
> org.geotools.styling.visitor.DuplicatingStyleVisitor.copy(DuplicatingStyleVisitor.java:470)
> at
> org.geotools.styling.visitor.DuplicatingStyleVisitor.visit(DuplicatingStyleVisitor.java:277)
> at
> org.geotools.renderer.lite.StreamingRenderer.rescaleFeatureTypeStyle(StreamingRenderer.java:2309)
> at
> org.geotools.renderer.lite.StreamingRenderer.applyUnitRescale(StreamingRenderer.java:2287)
> at
> org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1932)
> at
> org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:804)
> at org.geotools.swing.RenderingTask.call(RenderingTask.java:106)
> at org.geotools.swing.RenderingTask.call(RenderingTask.java:41)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:662)
>
> Is there a plan to update this tutorial (I would be happy to help) or is
> there a better way of showing a geotools hobbyist/dabbler how to write
> this? I've gotten through the steps of reading a shapefile and displaying
> a map, but I confess when I try to understand the relationship(s) between
> the seemingly infinite numbers of classes in the geotools library, it
> becomes a bit overwhelming.
>
> Any advice would be welcome - as I said, I'm a hobbyist at the GIS stuff,
> although I am a Java programmer by trade. I just need a pointer in the
> right direction (to a working example, for instance.)
>
> Thanks -
>
> Tom
>
>
> ------------------------------------------------------------------------------
> 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
>



------------------------------------------------------------------------------
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