Examples of toRectangle()


Examples of org.geotools.coverage.grid.GeneralGridEnvelope.toRectangle()

            final Envelope requestedEnvelopeCropped = CRS.transform(adjustedRequestedEnvelope,
                    requestedEnvelopeCRS2D);
            final Rectangle2D ordinates = CRS.transform(readGridToWorld.inverse(),
                    requestedEnvelopeCropped).toRectangle2D();
            final GeneralGridEnvelope finalRange = new GeneralGridEnvelope(ordinates.getBounds());
            final Rectangle tempRect = finalRange.toRectangle();
            // check that we stay inside the source rectangle
            XRectangle2D.intersect(tempRect, requestedDim, tempRect);
            requestedDim.setRect(tempRect);
        } catch (TransformException te) {
            // something bad happened while trying to transform this
View Full Code Here

Examples of org.geotools.coverage.grid.GeneralGridEnvelope.toRectangle()

                    }
                    return null;
                    // TODO: Future versions may define a 1x1 rectangle starting
                    // from the lower coordinate
                }
                if (!sourceRegion.intersects(baseGridRange.toRectangle()) || sourceRegion.isEmpty())
                    throw new DataSourceException("The crop region is invalid.");
                sourceRegion.setRect(sourceRegion.intersection(baseGridRange.toRectangle()));

                if (LOGGER.isLoggable(Level.FINE)) {
                    StringBuilder sb = new StringBuilder("Adjusted Requested Envelope = ")
View Full Code Here

Examples of org.geotools.coverage.grid.GeneralGridEnvelope.toRectangle()

                    // TODO: Future versions may define a 1x1 rectangle starting
                    // from the lower coordinate
                }
                if (!sourceRegion.intersects(baseGridRange.toRectangle()) || sourceRegion.isEmpty())
                    throw new DataSourceException("The crop region is invalid.");
                sourceRegion.setRect(sourceRegion.intersection(baseGridRange.toRectangle()));

                if (LOGGER.isLoggable(Level.FINE)) {
                    StringBuilder sb = new StringBuilder("Adjusted Requested Envelope = ")
                            .append(adjustedRequestedEnvelope.toString()).append("\n")
                            .append("Requested raster dimension = ")
View Full Code Here

Examples of org.geotools.coverage.io.RasterLayout.toRectangle()

            VariableAdapter.UnidataSpatialDomain spatialDomain = (UnidataSpatialDomain) source.getSpatialDomain();
            GridEnvelope2D gridRange = spatialDomain.getGridGeometry().getGridRange2D();
            RasterLayout rasterElement = spatialDomain.getRasterElements(false, null).iterator().next();
            SampleModel sampleModel = new BandedSampleModel(DataBuffer.TYPE_DOUBLE, (int)gridRange.getWidth(), (int)gridRange.getHeight(), 1);
            ColorModel colorModel = ImageIOUtilities.createColorModel(sampleModel);
            Rectangle rect = rasterElement.toRectangle();
            ImageLayout layout = new ImageLayout(rect.x, rect.y, rect.width, rect.height);
            layout.setSampleModel(sampleModel);
            layout.setColorModel(colorModel);
            return layout;
           
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.