GeoTools
  1. GeoTools
  2. GEOT-1277

Filters (and thus SLD) utility classes need to use Converter API

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.1, 2.4-M2
    • Fix Version/s: 2.7-M0
    • Component/s: main
    • Labels:
      None

      Description

      The Filters utility class is used in a number of places to do the common asDouble, asInt, and asType operations (required by the SLD utility class, and thus GridCoverageRenderer).

      Currently this class uses a bunch of logic, that does not include either:

      • evaulate( null, Float.class )
      • any mention of the converter api

      We need to fix both of these ...

      Here is an example stack trace as reported by F4.

      But now when I set this colormap, I obtain a new error :

      GRAVE: java.lang.Integer cannot be cast to java.lang.Double
      java.lang.ClassCastException: java.lang.Integer cannot be cast to
      java.lang.Double
      at
      org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.paint(GridCoverageRenderer.java:815)
      at
      org.geotools.renderer.lite.StreamingRenderer.renderRaster(StreamingRenderer.java:1828)
      at
      org.geotools.renderer.lite.StreamingRenderer.processSymbolizers(StreamingRenderer.java:1678)
      at
      org.geotools.renderer.lite.StreamingRenderer.process(StreamingRenderer.java:1622)
      at
      org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1564)
      at
      org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:714)
      at
      org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:436)
      at
      org.orbisgis.plugin.view.ui.OGMapControlModel.draw(OGMapControlModel.java:148)
      at
      org.orbisgis.plugin.view.ui.MapControl.paintComponent(MapControl.java:254)
      at javax.swing.JComponent.paint(JComponent.java:1022)
      at javax.swing.JComponent.paintToOffscreen(JComponent.java:5104)
      at
      javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:285)
      at javax.swing.RepaintManager.paint(RepaintManager.java:1132)
      at javax.swing.JComponent._paintImmediately(JComponent.java:5052)
      at javax.swing.JComponent.paintImmediately(JComponent.java:4862)
      at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:727)
      at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:683)
      at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:663)
      at
      javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
      at
      java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
      at
      java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
      at
      java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

      Any ideas ?

      My colormap :

      <ColorMap>
      <ColorMapEntry color="#FF0000" quantity="0.0"/>
      <ColorMapEntry color="#00FF00" quantity="100.0"/>
      <ColorMapEntry color="#0000FF" quantity="200.0"/>
      <ColorMapEntry color="#999999" quantity="30000.0"/>
      </ColorMap>

      I use geotools 2.3.1 and my gridcoverage is esri asc grid in integer.

        Activity

        Hide
        Jody Garnett added a comment -
        My impression is they now do.
        Show
        Jody Garnett added a comment - My impression is they now do.

          People

          • Assignee:
            Justin Deoliveira
            Reporter:
            Jody Garnett
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: