Ticket #18731: 18731.patch

File 18731.patch, 968 bytes (added by taylor.smock, 3 months ago)

Initial patch for searchPrimitives

  • src/org/openstreetmap/josm/data/osm/DataSet.java

     
    429429        }
    430430    }
    431431
     432    /**
     433     * Searches for all primitives in the given bounding box
     434     *
     435     * @param bbox the bounding box
     436     * @return List of primitives in the given bbox. Can be empty but not null
     437     * @since xxx
     438     */
     439    public List<OsmPrimitive> searchPrimitives(BBox bbox) {
     440        List<OsmPrimitive> primitiveList = new ArrayList<>();
     441        primitiveList.addAll(searchNodes(bbox));
     442        primitiveList.addAll(searchWays(bbox));
     443        primitiveList.addAll(searchRelations(bbox));
     444        return primitiveList;
     445    }
     446
    432447    @Override
    433448    public Collection<Relation> getRelations() {
    434449        return getPrimitives(Relation.class::isInstance);