Package org.opengis.geometry

Examples of org.opengis.geometry.BoundingBox


        synchronized (batchModified) {

            while (oldFeatures.hasNext()) {

                SimpleFeature old = oldFeatures.next();
                BoundingBox fbounds = old.getBounds();
                if (fbounds != null) {
                    bounds.expandToInclude(new ReferencedEnvelope(fbounds));
                }

                for (int i = 0; i < properties.length; i++) {
View Full Code Here


        // Checking the request and filling the missing fields
        //
        // //

        checkRequest(request);
        final BoundingBox requestedBoundingBox = request.getGeographicArea();
        final Rectangle requestedRasterArea = request.getRasterArea();
        final Set<TemporalGeometricPrimitive> temporalSubset = request.getTemporalSubset();
        final Set<NumberRange<Double>> verticalSubset = request.getVerticalSubset();
        final RangeType range = request.getRangeSubset();
        final Set<FieldType> fieldTypes = range.getFieldTypes();
View Full Code Here

//        }
    }
   

    private void checkRequest(CoverageReadRequest request) {
        BoundingBox requestedBoundingBox = request.getGeographicArea();

        // //
        //
        // Checking RequestedRasterArea setting
        //
View Full Code Here

   
    SimpleFeatureIterator it = polygonCollection.features();
    try {
        while (it.hasNext()) {
            feature = it.next();
            BoundingBox bounds = feature.getBounds();
            boundsCheck = ff.bbox(ff.property("the_geom"), bounds);
           
            Geometry geom = (Geometry) feature.getDefaultGeometry();
            polyCheck = ff.intersects(ff.property("the_geom"), ff.literal(geom));
           
View Full Code Here

    ReferencedEnvelope env; // can hold both regular ReferencedEnvelope as well as ReferencedEnvelope3D
    ReferencedEnvelope original = null; // can be instance of ReferencedEnvelope3D;   
    CoordinateReferenceSystem crs = null; //can be 2D or 3D
    org.opengis.geometry.Envelope opengis_env = null; //can be instance of ReferencedEnvelope(3D)
    com.vividsolutions.jts.geom.Envelope jts_env = null; //can be instance of ReferencedEnvelope(3D)
    BoundingBox bbox = null; //can be instance of ReferencedEnvelope(3D)
       
    //safely copy ReferencedEnvelope, uses type of original to determine type
    env = ReferencedEnvelope.create( original );
   
    //safely create ReferencedEnvelope from CRS, uses dimension to determine type
View Full Code Here

    }

    public Object visit(BBOX filter, Object extraData) {

        // grab the original envelope data
        BoundingBox boundaries = filter.getBounds();
        // parse the srs, it might be a code or a WKT definition
        CoordinateReferenceSystem crs = boundaries.getCoordinateReferenceSystem();
       
        // if no srs is specified we can't transform anyways
        if (crs == null)
            return super.visit(filter, extraData);
View Full Code Here

        }
    }

    @Test
    public void testToBounds() {
        BoundingBox testBox;

        try {
            newZealand.toBounds(crs);
            fail("Expected a missmatch of CoordianteReferenceSystem");
        } catch (TransformException t) {
            // expected
        }
        try {
            testBox = australia.toBounds(crs);
            // expected
            assertEquals("unexpected bounds x min after toBounds", 10, testBox.getMinX(), 0);
            assertEquals("unexpected bounds y min after toBounds", 110, testBox.getMinY(), 0);
            assertEquals("unexpected bounds x max after toBounds", 40, testBox.getMaxX(), 0);
            assertEquals("unexpected bounds y max after toBounds", 150, testBox.getMaxY(), 0);

        } catch (TransformException t) {
            fail("Missmatch of CoordianteReferenceSystem");
        }
    }
View Full Code Here

            for (SimpleFeature feature : featureList) {
                final String fid = feature.getID();
                final Geometry geometry = (Geometry) feature.getDefaultGeometry();
                if (geometry instanceof Polygon || geometry instanceof MultiPolygon) {
                    final BoundingBox bbox = feature.getBounds();

                    /*
                     * crop on region of interest
                     */
                    final CoverageProcessor processor = CoverageProcessor.getInstance();
View Full Code Here

    private void updateMinMaxFields(Expression expression) {
        if (expression instanceof Literal) {
            Literal bbox = (Literal) expression;
            Object value = bbox.getValue();
            if (value instanceof BoundingBox) {
                BoundingBox env = (BoundingBox) value;
                minx = env.getMinX();
                maxx = env.getMaxX();
                miny = env.getMinY();
                maxy = env.getMaxY();
                srs = CRS.toSRS(env.getCoordinateReferenceSystem());
            } else {
                Envelope env = null;
                if (value instanceof Envelope) {
                    env = (Envelope) value;
                } else if (value instanceof Geometry) {
                    Geometry geom = (Geometry) value;
                    env = geom.getEnvelopeInternal();
                    if (geom.getUserData() != null) {
                        if (geom.getUserData() instanceof String) {
                            srs = (String) geom.getUserData();
                        } else if (geom.getUserData() instanceof CoordinateReferenceSystem) {
                            srs = CRS.toSRS((CoordinateReferenceSystem) geom.getUserData());
                        }
                    }
                } else {
                    env = (Envelope) bbox.evaluate(null, Envelope.class);
                }
                if (env == null)
                    return;
                minx = env.getMinX();
                maxx = env.getMaxX();
                miny = env.getMinY();
                maxy = env.getMaxY();
            }
        }
    }
View Full Code Here

    public ReferencedEnvelope getBounds() {
        if (bounds == null) {
            bounds = new ReferencedEnvelope();

            for (Iterator i = contents.values().iterator(); i.hasNext();) {
                BoundingBox geomBounds = ((SimpleFeature) i.next()).getBounds();
                // IanS - as of 1.3, JTS expandToInclude ignores "null" Envelope
                // and simply adds the new bounds...
                // This check ensures this behavior does not occur.
                if (!geomBounds.isEmpty()) {
                    bounds.include(geomBounds);
                }
            }
        }
        return bounds;
View Full Code Here

TOP

Related Classes of org.opengis.geometry.BoundingBox

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.