Java Code Examples for com.vividsolutions.jts.geom.Geometry#getEnvelopeInternal()

The following examples show how to use com.vividsolutions.jts.geom.Geometry#getEnvelopeInternal() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JTSModel.java    From OpenMapKitAndroid with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private void removeWaysFromExistingDataSet(OSMDataSet existingDataSet, List<OSMWay> ways) {
    for (OSMWay w : ways) {
        OSMWay oldWay = existingDataSet.getWay(w.getId());
        if (oldWay != null) {
            Geometry geom = oldWay.getJTSGeom();
            if (geom != null) {
                Envelope env = geom.getEnvelopeInternal();
                spatialIndex.remove(env, oldWay);
            }
        }
    }
}
 
Example 2
Source File: JTSModel.java    From OpenMapKitAndroid with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Removes the OSMElement from the Spatial Index
 * if the element there.
 *
 * @param el - any OSMElement
 */
public void removeOSMElement(OSMElement el) {
    Geometry geom = el.getJTSGeom();
    if (geom != null) {
        Envelope env = geom.getEnvelopeInternal();
        spatialIndex.remove(env, el);
    }
}
 
Example 3
Source File: MiscellaneousTest.java    From jts with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void testEnvelopeCloned() throws Exception {
    Geometry a = reader.read("LINESTRING(0 0, 10 10)");
    //Envelope is lazily initialized [Jon Aquino]
    a.getEnvelopeInternal();
    Geometry b = a.copy();
    assertTrue(a.getEnvelopeInternal() != b.getEnvelopeInternal());
}