GeoTools
  1. GeoTools
  2. GEOT-2845

MapLayerUtils.isGridLayer not good?

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.0
    • Fix Version/s: 2.6.1, 2.7-M0
    • Component/s: swing
    • Labels:
      None

      Description

      Hi Michael

      The utility method isGridLayer checks whether the Binding classname contains:
      private static final String GRID_PACKAGE = "org.geotools.coverage.grid";

      In my application the runtime class of an ASCII grid is "org.opengis.coverage.grid.GridCoverage"

      the patch for 2.6.x is attached adds check for "org.opengis.coverage.grid.*" also.

      Greetz,
      Steve

        Activity

        Hide
        Michael Bedward added a comment -
        Hi Steve,

        Thanks for this - it's a good catch. That method was a quick hack for FOSS4G. Perhaps a better long term solution would be to have a method in the map layer itself so that lets you check what sort of feature source it has. What do you think ?

        Michael
        Show
        Michael Bedward added a comment - Hi Steve, Thanks for this - it's a good catch. That method was a quick hack for FOSS4G. Perhaps a better long term solution would be to have a method in the map layer itself so that lets you check what sort of feature source it has. What do you think ? Michael
        Hide
        Stefan Alfons Tzeggai added a comment -
        Yes, that sounds like the better place for this check.
        Are we fine with
          boolean isGrid(),
        or do we need more?... I guess not...
        Show
        Stefan Alfons Tzeggai added a comment - Yes, that sounds like the better place for this check. Are we fine with   boolean isGrid(), or do we need more?... I guess not...
        Hide
        Michael Bedward added a comment -
        Replaced my dumb hack with a less dumb one :) The methods now test whether the class implements a one of the GeoAPI interfaces: GridCoverage or GridCoverageReader.

        r34441 in trunk
        r34442 in branches/2.6.x
        Show
        Michael Bedward added a comment - Replaced my dumb hack with a less dumb one :) The methods now test whether the class implements a one of the GeoAPI interfaces: GridCoverage or GridCoverageReader. r34441 in trunk r34442 in branches/2.6.x

          People

          • Assignee:
            Michael Bedward
            Reporter:
            Stefan Alfons Tzeggai
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: