static class GenericPhotometricPolicy extends RangePolicy {
@Override
public RangeType describe(GridCoverage2D coverage) {
final GridSampleDimension[] sampleDimensions = coverage.getSampleDimensions();
final HashSet<SampleDimension> samples = new HashSet<SampleDimension>(Arrays.asList(sampleDimensions));
final DimensionlessAxis axis=DimensionlessAxis.createFromRenderedImage(coverage.getRenderedImage());
final List<Axis<?,?>> axes= new ArrayList<Axis<?,?>>();
axes.add(axis);
final FieldType field = new DefaultFieldType( new NameImpl("photometric-FieldType"), new SimpleInternationalString("Photometric image field"), Dimensionless.UNIT,axes, samples);
final DefaultRangeType range = new DefaultRangeType( new NameImpl("photometric-RangeType"), new SimpleInternationalString("Photometric range field"), Collections.singleton(field) );
return range;