assertEquals(0, (area - sum) / area, 0.001);
}
private double computeTotalArea(int width, int height, ReferencedEnvelope envelope) {
AreaGridProcess process = new AreaGridProcess();
GridCoverage2D grid = process.execute(envelope, width, height);
assertEquals(envelope, new ReferencedEnvelope(grid.getEnvelope()));
assertEquals(width, grid.getGridGeometry().getGridRange().getSpan(0));
assertEquals(height, grid.getGridGeometry().getGridRange().getSpan(1));
double sum = 0.0;