Search in sources :

Example 41 with WritableRandomIter

use of javax.media.jai.iterator.WritableRandomIter in project hortonmachine by TheHortonMachine.

the class OmsInsolation method process.

@Execute
public void process() throws Exception {
    // transform the
    checkNull(inElev, tStartDate, tEndDate);
    // extract some attributes of the map
    HashMap<String, Double> attribute = CoverageUtilities.getRegionParamsFromGridCoverage(inElev);
    double dx = attribute.get(CoverageUtilities.XRES);
    /*
         * The models use only one value of the latitude. So I have decided to
         * set it to the center of the raster. Extract the CRS of the
         * GridCoverage and transform the value of a WGS84 latitude.
         */
    CoordinateReferenceSystem sourceCRS = inElev.getCoordinateReferenceSystem2D();
    CoordinateReferenceSystem targetCRS = DefaultGeographicCRS.WGS84;
    double[] srcPts = new double[] { attribute.get(CoverageUtilities.EAST), attribute.get(CoverageUtilities.SOUTH) };
    Coordinate source = new Coordinate(srcPts[0], srcPts[1]);
    Point[] so = new Point[] { GeometryUtilities.gf().createPoint(source) };
    CrsUtilities.reproject(sourceCRS, targetCRS, so);
    // the latitude value
    lambda = Math.toRadians(so[0].getY());
    /*
         * transform the start and end date in an int value (the day in the
         * year, from 1 to 365)
         */
    DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd").withZone(DateTimeZone.UTC);
    DateTime currentDatetime = formatter.parseDateTime(tStartDate);
    int startDay = currentDatetime.getDayOfYear();
    currentDatetime = formatter.parseDateTime(tEndDate);
    int endDay = currentDatetime.getDayOfYear();
    CoverageUtilities.getRegionParamsFromGridCoverage(inElev);
    RenderedImage pitTmpRI = inElev.getRenderedImage();
    int width = pitTmpRI.getWidth();
    int height = pitTmpRI.getHeight();
    WritableRaster pitWR = CoverageUtilities.replaceNovalue(pitTmpRI, -9999.0);
    pitTmpRI = null;
    WritableRaster insolationWR = CoverageUtilities.createWritableRaster(width, height, null, pitWR.getSampleModel(), 0.0);
    WritableRandomIter insolationIterator = RandomIterFactory.createWritable(insolationWR, null);
    WritableRaster gradientWR = normalVector(pitWR, dx);
    pm.beginTask(msg.message("insolation.calculating"), endDay - startDay);
    for (int i = startDay; i <= endDay; i++) {
        calcInsolation(lambda, pitWR, gradientWR, insolationWR, i, dx);
        pm.worked(i - startDay);
    }
    pm.done();
    for (int y = 2; y < height - 2; y++) {
        for (int x = 2; x < width - 2; x++) {
            if (HMConstants.isNovalue(pitWR.getSampleDouble(x, y, 0))) {
                insolationIterator.setSample(x, y, 0, HMConstants.doubleNovalue);
            }
        }
    }
    outIns = CoverageUtilities.buildCoverage("insolation", insolationWR, attribute, inElev.getCoordinateReferenceSystem());
}
Also used : Point(org.locationtech.jts.geom.Point) DateTime(org.joda.time.DateTime) Point(org.locationtech.jts.geom.Point) WritableRandomIter(javax.media.jai.iterator.WritableRandomIter) Coordinate(org.locationtech.jts.geom.Coordinate) WritableRaster(java.awt.image.WritableRaster) CoordinateReferenceSystem(org.opengis.referencing.crs.CoordinateReferenceSystem) RenderedImage(java.awt.image.RenderedImage) DateTimeFormatter(org.joda.time.format.DateTimeFormatter) Execute(oms3.annotations.Execute)

Example 42 with WritableRandomIter

use of javax.media.jai.iterator.WritableRandomIter in project hortonmachine by TheHortonMachine.

the class OmsIntensityClassifierDebrisFlowTN method process.

// VARS DOC END
@Execute
public void process() throws Exception {
    if (!concatOr(outIntensity == null, doReset)) {
        return;
    }
    checkNull(// 
    inVelocity, // 
    pUpperThresVelocity, // 
    pLowerThresVelocity, // 
    inWaterDepth, // 
    pUpperThresWaterdepth, // 
    pLowerThresWaterdepth, // 
    inErosionDepth, // 
    pUpperThresErosionDepth, // 
    pLowerThresErosionDepth, // 
    inDepositsThickness, // 
    pUpperThresDepositsThickness, // 
    pLowerThresDepositsThickness);
    // do autoboxing only once
    double maxWD = pUpperThresWaterdepth;
    double minWD = pLowerThresWaterdepth;
    double maxV = pUpperThresVelocity;
    double minV = pLowerThresVelocity;
    double maxED = pUpperThresErosionDepth;
    double minED = pLowerThresErosionDepth;
    double maxDT = pUpperThresDepositsThickness;
    double minDT = pLowerThresDepositsThickness;
    RegionMap regionMap = CoverageUtilities.getRegionParamsFromGridCoverage(inWaterDepth);
    int nCols = regionMap.getCols();
    int nRows = regionMap.getRows();
    RandomIter waterdepthIter = CoverageUtilities.getRandomIterator(inWaterDepth);
    RandomIter velocityIter = CoverageUtilities.getRandomIterator(inVelocity);
    RandomIter erosiondepthIter = CoverageUtilities.getRandomIterator(inErosionDepth);
    RandomIter depositThicknessIter = CoverageUtilities.getRandomIterator(inDepositsThickness);
    WritableRaster outWR = CoverageUtilities.createWritableRaster(nCols, nRows, null, null, doubleNovalue);
    WritableRandomIter outIter = RandomIterFactory.createWritable(outWR, null);
    pm.beginTask("Processing map...", nRows);
    for (int r = 0; r < nRows; r++) {
        if (isCanceled(pm)) {
            return;
        }
        for (int c = 0; c < nCols; c++) {
            double h = waterdepthIter.getSampleDouble(c, r, 0);
            double v = velocityIter.getSampleDouble(c, r, 0);
            double ed = erosiondepthIter.getSampleDouble(c, r, 0);
            double dt = depositThicknessIter.getSampleDouble(c, r, 0);
            if (isNovalue(h) && isNovalue(v) && isNovalue(ed) && isNovalue(dt)) {
                continue;
            } else if (!isNovalue(h) && !isNovalue(v) && !isNovalue(ed) && !isNovalue(dt)) {
                double value = 0.0;
                if (h > maxWD || v > maxV || dt > maxDT || ed > maxED) {
                    value = INTENSITY_HIGH;
                } else if (// 
                (h <= maxWD && h > minWD) || // 
                (v <= maxV && v > minV) || // 
                (dt <= maxDT && dt > minDT) || (ed <= maxED && ed > minED)) {
                    value = INTENSITY_MEDIUM;
                } else if (h <= minWD || v <= minV || dt <= minDT || ed <= minED) {
                    value = INTENSITY_LOW;
                } else {
                    throw new ModelsIllegalargumentException("No intensity could be calculated for h = " + h + " and v = " + v + " and ed = " + ed + " and dt = " + dt, this, pm);
                }
                outIter.setSample(c, r, 0, value);
            } else {
                pm.errorMessage("WARNING: a cell was found in which one of velocity, water depth, erosion depth or deposit thickness are novalue, while the other not. /nThe maps should be covering the exact same cells. /nGoing on ignoring the cell: " + c + "/" + r);
            }
        }
        pm.worked(1);
    }
    pm.done();
    outIntensity = CoverageUtilities.buildCoverage("intensity", outWR, regionMap, inWaterDepth.getCoordinateReferenceSystem());
}
Also used : ModelsIllegalargumentException(org.hortonmachine.gears.libs.exceptions.ModelsIllegalargumentException) WritableRandomIter(javax.media.jai.iterator.WritableRandomIter) WritableRaster(java.awt.image.WritableRaster) RegionMap(org.hortonmachine.gears.utils.RegionMap) RandomIter(javax.media.jai.iterator.RandomIter) WritableRandomIter(javax.media.jai.iterator.WritableRandomIter) Execute(oms3.annotations.Execute)

Example 43 with WritableRandomIter

use of javax.media.jai.iterator.WritableRandomIter in project hortonmachine by TheHortonMachine.

the class OmsIntensityClassifierFlood method process.

// VARS DOC END
@Execute
public void process() throws Exception {
    if (!concatOr(outIntensity == null, doReset)) {
        return;
    }
    checkNull(inWaterDepth, inVelocity, pUpperThresVelocityWaterdepth, pUpperThresWaterdepth, pLowerThresVelocityWaterdepth, pLowerThresWaterdepth);
    // do autoboxing only once
    double maxWD = pUpperThresWaterdepth;
    double maxVWD = pUpperThresVelocityWaterdepth;
    double minWD = pLowerThresWaterdepth;
    double minVWD = pLowerThresVelocityWaterdepth;
    RegionMap regionMap = CoverageUtilities.getRegionParamsFromGridCoverage(inWaterDepth);
    int nCols = regionMap.getCols();
    int nRows = regionMap.getRows();
    RandomIter waterdepthIter = CoverageUtilities.getRandomIterator(inWaterDepth);
    RandomIter velocityIter = CoverageUtilities.getRandomIterator(inVelocity);
    WritableRaster outWR = CoverageUtilities.createWritableRaster(nCols, nRows, null, null, doubleNovalue);
    WritableRandomIter outIter = RandomIterFactory.createWritable(outWR, null);
    pm.beginTask("Processing map...", nRows);
    for (int r = 0; r < nRows; r++) {
        if (isCanceled(pm)) {
            return;
        }
        for (int c = 0; c < nCols; c++) {
            double h = waterdepthIter.getSampleDouble(c, r, 0);
            double v = velocityIter.getSampleDouble(c, r, 0);
            if (isNovalue(h) && isNovalue(v)) {
                continue;
            } else if (!isNovalue(h) && !isNovalue(v)) {
                double value = 0.0;
                double vh = v * h;
                if (h > maxWD || vh > maxVWD) {
                    value = INTENSITY_HIGH;
                } else if ((h > minWD && h <= maxWD) || (vh > minVWD && vh <= maxVWD)) {
                    value = INTENSITY_MEDIUM;
                } else if (h <= minWD && vh <= minVWD) {
                    value = INTENSITY_LOW;
                } else {
                    throw new ModelsIllegalargumentException("No intensity could be calculated for h = " + h + " and v = " + v, this, pm);
                }
                outIter.setSample(c, r, 0, value);
            } else {
                pm.errorMessage("WARNING: a cell was found in which one of velocity and water depth are novalue, while the other not. /nThe maps should be covering the exact same cells. /nGoing on ignoring the cell: " + c + "/" + r);
            }
        }
        pm.worked(1);
    }
    pm.done();
    outIntensity = CoverageUtilities.buildCoverage("intensity", outWR, regionMap, inWaterDepth.getCoordinateReferenceSystem());
}
Also used : ModelsIllegalargumentException(org.hortonmachine.gears.libs.exceptions.ModelsIllegalargumentException) WritableRandomIter(javax.media.jai.iterator.WritableRandomIter) WritableRaster(java.awt.image.WritableRaster) RegionMap(org.hortonmachine.gears.utils.RegionMap) RandomIter(javax.media.jai.iterator.RandomIter) WritableRandomIter(javax.media.jai.iterator.WritableRandomIter) Execute(oms3.annotations.Execute)

Example 44 with WritableRandomIter

use of javax.media.jai.iterator.WritableRandomIter in project imageio-ext by geosolutions-it.

the class HOPSConverter method Resampler.

private WritableRaster Resampler(final Array latData, final Array lonData, final int imageWidth, final int imageHeight, final int polyDegree, final Array data, final float fillValue) {
    final Index latIndex = latData.getIndex();
    final Index lonIndex = lonData.getIndex();
    final int numCoeffs = (polyDegree + 1) * (polyDegree + 2) / 2;
    final int XOFFSET = 0;
    final int YOFFSET = 1;
    final int stepX = 2;
    final int stepY = 2;
    int numNeededPoints = 0;
    for (int xi = 0; xi < imageWidth; xi += stepX) {
        for (int yi = 0; yi < imageHeight; yi += stepY) {
            numNeededPoints++;
        }
    }
    computeMatrixExtremes(latData, lonData, imageWidth, imageHeight, latIndex, lonIndex);
    float[] destCoords = new float[2 * numNeededPoints];
    float[] srcCoords = new float[2 * numNeededPoints];
    /*
         * Copy source and destination coordinates into float arrays. The
         * destination coordinates are scaled in order to gets values similar to
         * source coordinates (values will be identical if all "real world"
         * coordinates are grid indices multiplied by a constant).
         */
    int offset = 0;
    for (int yi = 0; yi < imageHeight; yi += stepY) {
        for (int xi = 0; xi < imageWidth; xi += stepX) {
            srcCoords[offset] = xi;
            srcCoords[offset + 1] = yi;
            destCoords[offset] = (float) ((lonData.getFloat(lonIndex.set(xi)) - this.xmin) / this.periodX);
            destCoords[offset + 1] = (float) ((this.ymax - latData.getFloat(latIndex.set(yi))) / this.periodY);
            // destCoords[offset + 1] = ((latData.getFloat(latIndex.set(yi)) - this.ymin) / this.periodY);
            offset += 2;
        }
    }
    GMatrix A = new GMatrix(numNeededPoints, numCoeffs);
    for (int coord = 0; coord < numNeededPoints; coord++) {
        int var = 0;
        for (int i = 0; i <= polyDegree; i++) {
            for (int j = 0; j <= i; j++) {
                double value = Math.pow(destCoords[2 * coord + XOFFSET], (double) (i - j)) * Math.pow(destCoords[2 * coord + YOFFSET], (double) j);
                A.setElement(coord, var++, value);
            }
        }
    }
    GMatrix AtAi = new GMatrix(numCoeffs, numCoeffs);
    GMatrix Ap = new GMatrix(numCoeffs, numNeededPoints);
    AtAi.mulTransposeLeft(A, A);
    AtAi.invert();
    Ap.mulTransposeRight(AtAi, A);
    GMatrix xVector = new GMatrix(numNeededPoints, 1);
    GMatrix yVector = new GMatrix(numNeededPoints, 1);
    for (int idx = 0; idx < numNeededPoints; idx++) {
        xVector.setElement(idx, 0, srcCoords[2 * idx + XOFFSET]);
        yVector.setElement(idx, 0, srcCoords[2 * idx + YOFFSET]);
    }
    GMatrix xCoeffsG = new GMatrix(numCoeffs, 1);
    GMatrix yCoeffsG = new GMatrix(numCoeffs, 1);
    xCoeffsG.mul(Ap, xVector);
    yCoeffsG.mul(Ap, yVector);
    float[] xCoeffs = new float[numCoeffs];
    float[] yCoeffs = new float[numCoeffs];
    for (int ii = 0; ii < numCoeffs; ii++) {
        xCoeffs[ii] = new Double(xCoeffsG.getElement(ii, 0)).floatValue();
        yCoeffs[ii] = new Double(yCoeffsG.getElement(ii, 0)).floatValue();
    }
    WritableRaster outDataCube;
    WritableRandomIter iteratorDataCube;
    SampleModel outSampleModel = RasterFactory.createBandedSampleModel(// data type
    DataBuffer.TYPE_FLOAT, // width
    imageWidth, // height
    imageHeight, // num bands
    1);
    outDataCube = Raster.createWritableRaster(outSampleModel, null);
    iteratorDataCube = RandomIterFactory.createWritable(outDataCube, null);
    // Transfering data in the WritableRaster structure
    Index indexInputVar = data.getIndex();
    for (int jj = 0; jj < outDataCube.getNumBands(); jj++) {
        for (int kk = 0; kk < outDataCube.getWidth(); kk++) {
            for (int ll = 0; ll < outDataCube.getHeight(); ll++) {
                iteratorDataCube.setSample(kk, ll, jj, data.getFloat(indexInputVar.set(ll, kk)));
            }
        }
    }
    WritableRaster target = RasterFactory.createWritableRaster(outSampleModel, null);
    for (int bi = 0; bi < outDataCube.getNumBands(); bi++) {
        for (int yi = 0; yi < imageHeight; yi++) {
            for (int xi = 0; xi < imageWidth; xi++) {
                float[] dstCoords = new float[2];
                GMatrix regressionVec = new GMatrix(numCoeffs, 1);
                int var = 0;
                for (int i = 0; i <= polyDegree; i++) {
                    for (int j = 0; j <= i; j++) {
                        double value = Math.pow(xi, (double) (i - j)) * Math.pow(yi, (double) j);
                        regressionVec.setElement(var++, 0, value);
                    }
                }
                GMatrix xG = new GMatrix(1, 1);
                GMatrix yG = new GMatrix(1, 1);
                xG.mulTransposeLeft(regressionVec, xCoeffsG);
                yG.mulTransposeLeft(regressionVec, yCoeffsG);
                int X = (int) Math.round(xG.getElement(0, 0));
                int Y = (int) Math.round(yG.getElement(0, 0));
                if (X >= 0 && Y >= 0 && X < imageWidth && Y < imageHeight) {
                    target.setSample(xi, yi, bi, outDataCube.getSampleFloat(X, Y, bi));
                } else {
                    // TODO: Change with fillvalue
                    // target.setSample(xi, yi, bi, Float.NaN);
                    target.setSample(xi, yi, bi, fillValue);
                }
            }
        }
    }
    return target;
}
Also used : WritableRandomIter(javax.media.jai.iterator.WritableRandomIter) SampleModel(java.awt.image.SampleModel) GMatrix(javax.vecmath.GMatrix) WritableRaster(java.awt.image.WritableRaster) Index(ucar.ma2.Index)

Example 45 with WritableRandomIter

use of javax.media.jai.iterator.WritableRandomIter in project imageio-ext by geosolutions-it.

the class InterpolateVNetCDF method Resampler.

private WritableRaster Resampler(final Array latData, final Array lonData, final int imageWidth, final int imageHeight, final int polyDegree, final Array data, final float fillValue, final int tv) {
    final Index latIndex = latData.getIndex();
    final Index lonIndex = lonData.getIndex();
    final int numCoeffs = (polyDegree + 1) * (polyDegree + 2) / 2;
    final int XOFFSET = 0;
    final int YOFFSET = 1;
    final int stepX = 2;
    final int stepY = 2;
    int numNeededPoints = 0;
    for (int xi = 0; xi < imageWidth; xi += stepX) {
        for (int yi = 0; yi < imageHeight; yi += stepY) {
            numNeededPoints++;
        }
    }
    computeMatrixExtremes(latData, lonData, imageWidth, imageHeight, latIndex, lonIndex, tv);
    float[] destCoords = new float[2 * numNeededPoints];
    float[] srcCoords = new float[2 * numNeededPoints];
    /*
         * Copy source and destination coordinates into float arrays. The
         * destination coordinates are scaled in order to gets values similar to
         * source coordinates (values will be identical if all "real world"
         * coordinates are grid indices multiplied by a constant).
         */
    final float xmin = xminTV[tv];
    final float xperiod = xperiodTV[tv];
    final float ymax = ymaxTV[tv];
    final float yperiod = yperiodTV[tv];
    int offset = 0;
    for (int yi = 0; yi < imageHeight; yi += stepY) {
        for (int xi = 0; xi < imageWidth; xi += stepX) {
            srcCoords[offset] = xi;
            srcCoords[offset + 1] = yi;
            destCoords[offset] = (float) ((lonData.getFloat(lonIndex.set(xi)) - xmin) / xperiod);
            destCoords[offset + 1] = (float) ((ymax - latData.getFloat(latIndex.set(yi))) / yperiod);
            // destCoords[offset + 1] = ((latData.getFloat(latIndex.set(yi))
            // - this.ymin) / this.periodY);
            offset += 2;
        }
    }
    GMatrix A = new GMatrix(numNeededPoints, numCoeffs);
    for (int coord = 0; coord < numNeededPoints; coord++) {
        int var = 0;
        for (int i = 0; i <= polyDegree; i++) {
            for (int j = 0; j <= i; j++) {
                double value = Math.pow(destCoords[2 * coord + XOFFSET], (double) (i - j)) * Math.pow(destCoords[2 * coord + YOFFSET], (double) j);
                A.setElement(coord, var++, value);
            }
        }
    }
    GMatrix AtAi = new GMatrix(numCoeffs, numCoeffs);
    GMatrix Ap = new GMatrix(numCoeffs, numNeededPoints);
    AtAi.mulTransposeLeft(A, A);
    AtAi.invert();
    Ap.mulTransposeRight(AtAi, A);
    GMatrix xVector = new GMatrix(numNeededPoints, 1);
    GMatrix yVector = new GMatrix(numNeededPoints, 1);
    for (int idx = 0; idx < numNeededPoints; idx++) {
        xVector.setElement(idx, 0, srcCoords[2 * idx + XOFFSET]);
        yVector.setElement(idx, 0, srcCoords[2 * idx + YOFFSET]);
    }
    GMatrix xCoeffsG = new GMatrix(numCoeffs, 1);
    GMatrix yCoeffsG = new GMatrix(numCoeffs, 1);
    xCoeffsG.mul(Ap, xVector);
    yCoeffsG.mul(Ap, yVector);
    float[] xCoeffs = new float[numCoeffs];
    float[] yCoeffs = new float[numCoeffs];
    for (int ii = 0; ii < numCoeffs; ii++) {
        xCoeffs[ii] = new Double(xCoeffsG.getElement(ii, 0)).floatValue();
        yCoeffs[ii] = new Double(yCoeffsG.getElement(ii, 0)).floatValue();
    }
    WritableRaster outDataCube;
    WritableRandomIter iteratorDataCube;
    SampleModel outSampleModel = RasterFactory.createBandedSampleModel(// data type
    DataBuffer.TYPE_FLOAT, // width
    imageWidth, // height
    imageHeight, // num bands
    1);
    outDataCube = Raster.createWritableRaster(outSampleModel, null);
    iteratorDataCube = RandomIterFactory.createWritable(outDataCube, null);
    // Transfering data in the WritableRaster structure
    Index indexInputVar = data.getIndex();
    for (int jj = 0; jj < outDataCube.getNumBands(); jj++) {
        for (int kk = 0; kk < outDataCube.getWidth(); kk++) {
            for (int ll = 0; ll < outDataCube.getHeight(); ll++) {
                iteratorDataCube.setSample(kk, ll, jj, data.getFloat(indexInputVar.set(ll, kk)));
            }
        }
    }
    WritableRaster target = RasterFactory.createWritableRaster(outSampleModel, null);
    for (int bi = 0; bi < outDataCube.getNumBands(); bi++) {
        for (int yi = 0; yi < imageHeight; yi++) {
            for (int xi = 0; xi < imageWidth; xi++) {
                float[] dstCoords = new float[2];
                GMatrix regressionVec = new GMatrix(numCoeffs, 1);
                int var = 0;
                for (int i = 0; i <= polyDegree; i++) {
                    for (int j = 0; j <= i; j++) {
                        double value = Math.pow(xi, (double) (i - j)) * Math.pow(yi, (double) j);
                        regressionVec.setElement(var++, 0, value);
                    }
                }
                GMatrix xG = new GMatrix(1, 1);
                GMatrix yG = new GMatrix(1, 1);
                xG.mulTransposeLeft(regressionVec, xCoeffsG);
                yG.mulTransposeLeft(regressionVec, yCoeffsG);
                int X = (int) Math.round(xG.getElement(0, 0));
                int Y = (int) Math.round(yG.getElement(0, 0));
                if (X >= 0 && Y >= 0 && X < imageWidth && Y < imageHeight) {
                    target.setSample(xi, yi, bi, outDataCube.getSampleFloat(X, Y, bi));
                } else {
                    // TODO: Change with fillvalue
                    // target.setSample(xi, yi, bi, Float.NaN);
                    target.setSample(xi, yi, bi, fillValue);
                }
            }
        }
    }
    return target;
}
Also used : WritableRandomIter(javax.media.jai.iterator.WritableRandomIter) SampleModel(java.awt.image.SampleModel) GMatrix(javax.vecmath.GMatrix) WritableRaster(java.awt.image.WritableRaster) Index(ucar.ma2.Index)

Aggregations

WritableRandomIter (javax.media.jai.iterator.WritableRandomIter)99 WritableRaster (java.awt.image.WritableRaster)85 RandomIter (javax.media.jai.iterator.RandomIter)60 RegionMap (org.hortonmachine.gears.utils.RegionMap)59 Execute (oms3.annotations.Execute)49 Coordinate (org.locationtech.jts.geom.Coordinate)20 GridCoverage2D (org.geotools.coverage.grid.GridCoverage2D)18 ModelsIllegalargumentException (org.hortonmachine.gears.libs.exceptions.ModelsIllegalargumentException)18 GridGeometry2D (org.geotools.coverage.grid.GridGeometry2D)17 RenderedImage (java.awt.image.RenderedImage)16 Point (java.awt.Point)11 ArrayList (java.util.ArrayList)11 Geometry (org.locationtech.jts.geom.Geometry)11 GridCoordinates2D (org.geotools.coverage.grid.GridCoordinates2D)10 FlowNode (org.hortonmachine.gears.libs.modules.FlowNode)10 DirectPosition2D (org.geotools.geometry.DirectPosition2D)9 CoordinateReferenceSystem (org.opengis.referencing.crs.CoordinateReferenceSystem)8 Envelope (org.locationtech.jts.geom.Envelope)7 DirectPosition (org.opengis.geometry.DirectPosition)7 SampleModel (java.awt.image.SampleModel)6