Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Problem with custom SLD style

Please keep discussion on the list (that way I can be corrected by others :-D ).

Sorry for the quick message before; was focused on getting a bug report in. I was not being intentionally opaque - the geotools website is down for me as well.

Looking at the code the functions are:
- CategorizeFunction
- InterpolateFunction
- RecodeFunction

Example docs for the first one:

Implementation of "Categorize" as a normal function.

This implementation is compatible with the Function interface; the parameter list can be used to set the threshold values etc...

This function expects:

  1. PropertyName; use "Rasterdata" to indicate this is a color map
  2. Literal: lookup value
  3. Literal: threshold 1
  4. Literal: value 1
  5. Literal: threshold 2
  6. Literal: value 2
  7. Literal: (Optional) succeeding or preceding
For more details please look at the Symbology Encoding specification (which provides the definition of these functions and examples.

Best thing to do is look at test cases:

Here is an example from the test cases:

        final String[] categories = {"low", "mid", "high", "super"};
        final Double[] thresholds = {0.0, 50.0, 100.0};
        setupParameters(categories, thresholds);

        Function fn = finder.findFunction("categorize", parameters);

Cheers,
Jody


On 05/08/2010, at 7:00 PM, Lukasz Stawicki wrote:

Jody,

I know I can use more <sld:Rule...> entries instead of using <ogc:Function name="if_then_else"> but this will make my SLD file 10 times longer (and unable to maintain it). What are the other options for managing colors?

regards

Lukasz


Cytowanie Jody Garnett <jody.garnett@xxxxxxxxx>:

The GeoTools website was hacked last month; I think the DNS is being updated now to point to a new server.

As for your example; you are doing a lot of work to map colours?  There is a couple of color lookup functions available now
which should make it easier.

I have reported your issue here:
- https://jira.codehaus.org/browse/GEOT-3234

On 05/08/2010, at 4:14 PM, Lukasz Stawicki wrote:


java.lang.IllegalArgumentException: Filter Function problem for function if_then_else argument #0 - expected type boolean
at org.geotools.filter.function.FilterFunction_if_then_else.evaluate(FilterFunction_if_then_else.java:45)
at org.geotools.filter._expression_.ExpressionAbstract.evaluate(ExpressionAbstract.java:63)
at org.geotools.styling.SLD.color(SLD.java:1312)
at org.geotools.styling.SLD.color(SLD.java:96)
at org.geotools.styling.SLD.lineColor(SLD.java:84)
at org.geotools.styling.SLD.color(SLD.java:188)
at net.refractions.udig.ui.Drawing.paint(Drawing.java:308)
at net.refractions.udig.ui.Drawing.drawFeature(Drawing.java:246)
at net.refractions.udig.ui.Drawing.drawFeature(Drawing.java:223)
at net.refractions.udig.ui.Drawing.drawDirect(Drawing.java:150)
at net.refractions.udig.ui.graphics.Glyph$6.getImageData(Glyph.java:363)







Back to the top