Package org.opengis.geometry

Examples of org.opengis.geometry.Envelope


        // Testing simple imageRead
        //
        // //

        useJAI.setValue(true);
        final Envelope wgs84Envelope = CRS.transform(oldEnvelope, DefaultGeographicCRS.WGS84);
        gg.setValue(new GridGeometry2D(reader.getOriginalGridRange(), wgs84Envelope));
        gc = (GridCoverage2D) reader.read(new GeneralParameterValue[] {gg, useJAI});
        assertNotNull(gc);
        forceDataLoading(gc);
    }
View Full Code Here


                // envelope. World file transformation assumes to work in the
                // CELL_CENTER condition
                //
                // //
                MathTransform tempTransform =PixelTranslation.translate(raster2Model, PixelInCell.CELL_CENTER, PixelInCell.CELL_CORNER);             
                final Envelope gridRange = new GeneralEnvelope((GridEnvelope2D)originalGridRange);
                final GeneralEnvelope coverageEnvelope = CRS.transform(tempTransform, gridRange);
                originalEnvelope=coverageEnvelope;
                return;
            } catch (TransformException e) {
                if (LOGGER.isLoggable(Level.WARNING)) {
View Full Code Here

                      "Try to clear the tmp/Geotools directory.", bbox);
        assertEquals(42.25, bbox.getSouthBoundLatitude(), EPS);
        assertEquals(51.10, bbox.getNorthBoundLatitude(), EPS);
        assertEquals(-5.20, bbox.getWestBoundLongitude(), EPS);
        assertEquals( 8.23, bbox.getEastBoundLongitude(), EPS);
        final Envelope envelope = CRS.getEnvelope(crs);
        assertEquals(46.944, envelope.getMinimum(0), 1E-3);
        assertEquals(56.777, envelope.getMaximum(0), 1E-3);
        assertEquals(-8.375, envelope.getMinimum(1), 1E-3);
        assertEquals( 6.548, envelope.getMaximum(1), 1E-3);
        assertNull(CRS.getEnvelope(null));
        final GeographicBoundingBox rep = new GeographicBoundingBoxImpl(envelope);
        assertEquals(42.25, rep.getSouthBoundLatitude(), 1E-3);
        assertEquals(51.10, rep.getNorthBoundLatitude(), 1E-3);
        assertEquals(-5.20, rep.getWestBoundLongitude(), 1E-3);
View Full Code Here

        /*
         * the envelope that was requested, i.e. what has to be given back in
         * terms of bounds and resolution.
         */
        Envelope requestedRegionEnvelope = null;
        /*
         * the read region, i.e. the requested region without the parts east and
         * south of the file region. (since they would produce negative origin)
         */
        Rectangle sourceRegion = null;
View Full Code Here

        }
       
        //
        // checking same Envelope and grid range
        //
        Envelope envA = coverageA.getEnvelope();
        Envelope envB = coverageB.getEnvelope();
        if (!envA.equals(envB)) {
            throw new ProcessException(MISMATCHING_ENVELOPE_MESSAGE);
        }
       
        GridEnvelope gridRangeA = coverageA.getGridGeometry().getGridRange();
View Full Code Here

       
       
        WebMapServer wms = new WebMapServer(new URL("http://test.org"), client);
        Layer layer = wms.getCapabilities().getLayer().getChildren()[2];
       
        Envelope env = wms.getEnvelope(layer, CRS.decode("EPSG:3005"));
       
        assertNotNull(env);
    }
View Full Code Here

        assertTrue(gc != null);
        assertTrue(CoverageUtilities.hasRenderingCategories(gc));

        checkMatrixEqual(gc.getRenderedImage(), mapData, 0);

        Envelope envelope = gc.getEnvelope();
        DirectPosition lowerCorner = envelope.getLowerCorner();
        double[] westSouth = lowerCorner.getCoordinate();
        DirectPosition upperCorner = envelope.getUpperCorner();
        double[] eastNorth = upperCorner.getCoordinate();

        GridGeometry2D gridGeometry = gc.getGridGeometry();
        GridEnvelope2D gridRange = gridGeometry.getGridRange2D();
        int height = gridRange.height;
View Full Code Here

        }
       
        CoordinateReferenceSystem crs = featureSource.getSchema().getCoordinateReferenceSystem();
        if (crs != null) {
            // returns the envelope based on the CoordinateReferenceSystem
            Envelope envelope = CRS.getEnvelope(crs);
            if (envelope != null) {
                return new ReferencedEnvelope(envelope); // nice!
            }
            else {
                return new ReferencedEnvelope(crs); // empty bounds
View Full Code Here

            //
            // //
           
            MathTransform tempTransform = PixelTranslation.translate(raster2Model, PixelInCell.CELL_CENTER, PixelInCell.CELL_CORNER);
            try {
                final Envelope gridRange = new GeneralEnvelope(nativeGridRange);
                final GeneralEnvelope coverageEnvelope = CRS.transform(
                    tempTransform, gridRange);
                nativeEnvelope = coverageEnvelope;
            } catch (TransformException e) {
                if (LOGGER.isLoggable(Level.WARNING)) {
View Full Code Here

    }

    public Object evaluate(Object gc) {
        GridCoverage2D coverage = (GridCoverage2D) gc;

        Envelope env = coverage.getEnvelope();
        GeometryFactory gf = new GeometryFactory();
        Point center = gf.createPoint(new Coordinate(env.getMedian(0), env.getMedian(1)));

        SimpleFeatureTypeBuilder tb = new SimpleFeatureTypeBuilder();
        tb.setName("center");
        tb.add("geom", Point.class, coverage.getCoordinateReferenceSystem2D());
        SimpleFeatureType ft = tb.buildFeatureType();
View Full Code Here

TOP

Related Classes of org.opengis.geometry.Envelope

Copyright © 2018 www.massapicom. 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.