use of org.opengis.coverage.grid.GridCoordinates in project geotoolkit by Geomatys.
the class GetCoverageType method getSize.
/**
* {@inheritDoc}
*/
@Override
public Dimension getSize() {
if (domainSubset == null || domainSubset.getSpatialSubSet() == null || domainSubset.getSpatialSubSet().getGrid() == null || domainSubset.getSpatialSubSet().getGrid().getLimits() == null || domainSubset.getSpatialSubSet().getGrid().getLimits().getGridEnvelope() == null) {
return null;
}
final GridEnvelopeType gridEnv = domainSubset.getSpatialSubSet().getGrid().getLimits().getGridEnvelope();
GridCoordinates high = gridEnv.getHigh();
if (high == null) {
return null;
}
if (high.getCoordinateValues().length < 2) {
return null;
}
final int width = Math.toIntExact(high.getCoordinateValue(0));
final int height = Math.toIntExact(high.getCoordinateValue(1));
return new Dimension(width, height);
}
Aggregations