Michael Bedward ha scritto:
> 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 ?
> 
> Andrea, what do you think about a MapLayer method, perhaps returning
> an enum to indicate the vector features vs grid coverage vs grid
> coverage reader ?

Eh... what we really need is a complete overhaul of those classes,
they were conceived for just vector data and has been hacked upon
until this messy situation.

Hack for hack, I would try to be at least consistent with the renderer.
The renderer assumes you have a grid if the feature type has a "grid"
property that contains either a grid coverage or a grid coverage
reader. So I would do something like (pseudo code, untested):

PropertyDescriptor grid = type.getProperty("grid");
if(grid == null)
   return false;
Class binding = grid.getType().getBinding();
return AbstractGridCoverage2DReader.class.isAssignableFrom(binding) ||
        GridCoverage.class.isAssignableFrom(binding);

Cheers
Andrea
-- 
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to