Ticket #20514: 20514.quadbuckets.patch
File 20514.quadbuckets.patch, 1.3 KB (added by , 4 years ago) |
---|
-
src/org/openstreetmap/josm/data/osm/QuadBucketPrimitiveStore.java
1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.data.osm; 3 3 4 import java.util.ArrayList;5 import java.util.Collection;6 4 import java.util.List; 7 5 import java.util.function.Consumer; 8 import java.util.stream.Collectors;9 6 10 7 import org.openstreetmap.josm.tools.JosmRuntimeException; 11 8 … … 36 33 /** 37 34 * All relations/relationships 38 35 */ 39 private final Collection<R> relations = new ArrayList<>();36 private final QuadBuckets<R> relations = new QuadBuckets<>(); 40 37 41 38 /** 42 39 * Searches for nodes in the given bounding box. … … 80 77 * @return List of relations in the given bbox. Can be empty but not null 81 78 */ 82 79 public List<R> searchRelations(BBox bbox) { 83 // QuadBuckets might be useful here (don't forget to do reindexing after some of rm is changed) 84 return relations.stream() 85 .filter(r -> r.getBBox().intersects(bbox)) 86 .collect(Collectors.toList()); 80 return relations.search(bbox); 87 81 } 88 82 89 83 /**