Package org.geotools.geometry.jts

Examples of org.geotools.geometry.jts.ReferencedEnvelope.include()


        FeatureReader<SimpleFeatureType, SimpleFeature> featureReader = getReaderInternal(query);
        try {
            while (featureReader.hasNext()) {
                SimpleFeature feature = featureReader.next();
                bounds.include(feature.getBounds());
            }
        } finally {
            featureReader.close();
        }
        return bounds;
View Full Code Here


                BoundingBox geomBounds = feature.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 != null && !geomBounds.isEmpty() ) {
                    bounds.include(geomBounds);
                }
            }
            return bounds;
        }
        finally {
View Full Code Here

                //
                // Make union of all bounds
                //
                while (eReader.hasNext()) {
                    f = eReader.next();
                    bounds.include(f.getBounds());
                }
            }
        } finally {
            //
            // Always ensure that reader is closed to prevent memory leakage
View Full Code Here

        ReferencedEnvelope bounds = new ReferencedEnvelope(DefaultGeographicCRS.WGS84);
        try {
            while( reader.hasNext() ){
                SimpleFeature feature = reader.next();
                count++;
                bounds.include( feature.getBounds() );
            }
        }
        finally {
            if( reader != null ){
                reader.close();
View Full Code Here

        try {
            iterator = features.features();
            while( iterator.hasNext() ){
                SimpleFeature feature = iterator.next();
                count++;
                bounds.include( feature.getBounds() );
            }
        }
        finally {
            if( iterator != null ){
                iterator.close();
View Full Code Here

    // Direct access to internal upper and lower positions
    DirectPosition lower = bbox.getLowerCorner();
    DirectPosition upper = bbox.getUpperCorner();
   
    // expand to include 15, 30
    bbox.include(15, 30);
   
    // exampleBoundingBox end
}

//
View Full Code Here

    // Direct access to internal upper and lower positions
    DirectPosition lower = envelope.getLowerCorner();
    DirectPosition upper = envelope.getUpperCorner();
   
    // expand to include 15, 30
    envelope.include(15, 30);
   
    envelope.isEmpty(); // check if storing width and height are 0
   
    envelope.isNull(); // check if "null" (not storing anything)
    envelope.setToNull();
View Full Code Here

    public void testBounds() {
        MemoryFeatureCollection rivers = new MemoryFeatureCollection(riverType);
        ReferencedEnvelope expected = new ReferencedEnvelope();
        for (int i = 0; i < riverFeatures.length; i++) {
            rivers.add(riverFeatures[i]);
            expected.include(riverFeatures[i].getBounds());
        }
        assertEquals(riverFeatures.length, rivers.size());

        // Should not throw an UnsupportedOperationException
        assertNotNull(rivers.getBounds());
View Full Code Here

                        SimpleFeature f = i.next();
                        bounds.init(f.getBounds());

                        while (i.hasNext()) {
                            f = i.next();
                            bounds.include(f.getBounds());
                        }
                    }
                } finally {
                    i.close();
                }
View Full Code Here

        SimpleFeatureCollection some = road.getFeatures(td.rd12Filter);
        assertEquals(2, some.size());

        ReferencedEnvelope e = new ReferencedEnvelope(CRS.decode("EPSG:4326"));
        e.include(td.roadFeatures[0].getBounds());
        e.include(td.roadFeatures[1].getBounds());
//        assertEquals(e, some.getBounds());
        assertTrue(areReferencedEnvelopesEuqal(e, some.getBounds()));

        assertEquals(some.getSchema(), road.getSchema());
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.