1 | // License: GPL. Copyright 2007 by Immanuel Scholz and others
|
---|
2 | package org.openstreetmap.josm.data.osm;
|
---|
3 | import org.openstreetmap.josm.tools.ReverseLookup;
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 |
|
---|
6 | import java.awt.geom.Area;
|
---|
7 | import java.util.ArrayList;
|
---|
8 | import java.util.Arrays;
|
---|
9 | import java.util.Collection;
|
---|
10 | import java.util.Comparator;
|
---|
11 | import java.util.HashMap;
|
---|
12 | import java.util.HashSet;
|
---|
13 | import java.util.Iterator;
|
---|
14 | import java.util.LinkedList;
|
---|
15 | import java.util.List;
|
---|
16 | import java.util.Set;
|
---|
17 |
|
---|
18 | import org.openstreetmap.josm.data.SelectionChangedListener;
|
---|
19 | import org.openstreetmap.josm.data.osm.QuadBuckets;
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * DataSet is the data behind the application. It can consists of only a few points up to the whole
|
---|
23 | * osm database. DataSet's can be merged together, saved, (up/down/disk)loaded etc.
|
---|
24 | *
|
---|
25 | * Note that DataSet is not an osm-primitive and so has no key association but a few members to
|
---|
26 | * store some information.
|
---|
27 | *
|
---|
28 | * @author imi
|
---|
29 | */
|
---|
30 | public class DataSet implements Cloneable {
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * The API version that created this data set, if any.
|
---|
34 | */
|
---|
35 | public String version;
|
---|
36 |
|
---|
37 | /**
|
---|
38 | * All nodes goes here, even when included in other data (ways etc). This enables the instant
|
---|
39 | * conversion of the whole DataSet by iterating over this data structure.
|
---|
40 | */
|
---|
41 | public QuadBuckets<Node> nodes = new QuadBuckets<Node>();
|
---|
42 |
|
---|
43 | /**
|
---|
44 | * All ways (Streets etc.) in the DataSet.
|
---|
45 | *
|
---|
46 | * The way nodes are stored only in the way list.
|
---|
47 | */
|
---|
48 | public QuadBuckets<Way> ways = new QuadBuckets<Way>();
|
---|
49 |
|
---|
50 | /**
|
---|
51 | * All relations/relationships
|
---|
52 | */
|
---|
53 | public Collection<Relation> relations = new LinkedList<Relation>();
|
---|
54 |
|
---|
55 | /**
|
---|
56 | * All data sources of this DataSet.
|
---|
57 | */
|
---|
58 | public Collection<DataSource> dataSources = new LinkedList<DataSource>();
|
---|
59 |
|
---|
60 | /**
|
---|
61 | * A list of listeners to selection changed events. The list is static, as listeners register
|
---|
62 | * themselves for any dataset selection changes that occur, regardless of the current active
|
---|
63 | * dataset. (However, the selection does only change in the active layer)
|
---|
64 | */
|
---|
65 | public static Collection<SelectionChangedListener> selListeners = new LinkedList<SelectionChangedListener>();
|
---|
66 |
|
---|
67 | /**
|
---|
68 | * @return A collection containing all primitives of the dataset. The data is ordered after:
|
---|
69 | * first come nodes, then ways, then relations. Ordering in between the categories is not
|
---|
70 | * guaranteed.
|
---|
71 | */
|
---|
72 | public List<OsmPrimitive> allPrimitives() {
|
---|
73 | List<OsmPrimitive> o = new LinkedList<OsmPrimitive>();
|
---|
74 | o.addAll(nodes);
|
---|
75 | o.addAll(ways);
|
---|
76 | o.addAll(relations);
|
---|
77 | return o;
|
---|
78 | }
|
---|
79 |
|
---|
80 | /**
|
---|
81 | * @return A collection containing all not-deleted primitives (except keys).
|
---|
82 | */
|
---|
83 | public Collection<OsmPrimitive> allNonDeletedPrimitives() {
|
---|
84 | Collection<OsmPrimitive> o = new LinkedList<OsmPrimitive>();
|
---|
85 | for (OsmPrimitive osm : allPrimitives())
|
---|
86 | if (osm.isVisible() && !osm.isDeleted()) {
|
---|
87 | o.add(osm);
|
---|
88 | }
|
---|
89 | return o;
|
---|
90 | }
|
---|
91 |
|
---|
92 | public Collection<OsmPrimitive> allNonDeletedCompletePrimitives() {
|
---|
93 | Collection<OsmPrimitive> o = new LinkedList<OsmPrimitive>();
|
---|
94 | for (OsmPrimitive osm : allPrimitives())
|
---|
95 | if (osm.isVisible() && !osm.isDeleted() && !osm.incomplete) {
|
---|
96 | o.add(osm);
|
---|
97 | }
|
---|
98 | return o;
|
---|
99 | }
|
---|
100 |
|
---|
101 | public Collection<OsmPrimitive> allNonDeletedPhysicalPrimitives() {
|
---|
102 | Collection<OsmPrimitive> o = new LinkedList<OsmPrimitive>();
|
---|
103 | for (OsmPrimitive osm : allPrimitives())
|
---|
104 | if (osm.isVisible() && !osm.isDeleted() && !osm.incomplete && !(osm instanceof Relation)) {
|
---|
105 | o.add(osm);
|
---|
106 | }
|
---|
107 | return o;
|
---|
108 | }
|
---|
109 |
|
---|
110 | /**
|
---|
111 | * Adds a primitive to the dataset
|
---|
112 | *
|
---|
113 | * @param primitive the primitive. Ignored if null.
|
---|
114 | */
|
---|
115 | public void addPrimitive(OsmPrimitive primitive) {
|
---|
116 | if (primitive == null)
|
---|
117 | return;
|
---|
118 | if (primitive instanceof Node) {
|
---|
119 | nodes.add((Node) primitive);
|
---|
120 | } else if (primitive instanceof Way) {
|
---|
121 | ways.add((Way) primitive);
|
---|
122 | } else if (primitive instanceof Relation) {
|
---|
123 | relations.add((Relation) primitive);
|
---|
124 | }
|
---|
125 | }
|
---|
126 |
|
---|
127 | /**
|
---|
128 | * Removes a primitive from the dataset. This method only removes the
|
---|
129 | * primitive form the respective collection of primitives managed
|
---|
130 | * by this dataset, i.e. from {@see #nodes}, {@see #ways}, or
|
---|
131 | * {@see #relations}. References from other primitives to this
|
---|
132 | * primitive are left unchanged.
|
---|
133 | *
|
---|
134 | * @param primitive the primitive. Ignored if null.
|
---|
135 | */
|
---|
136 | public void removePrimitive(OsmPrimitive primitive) {
|
---|
137 | if (primitive == null)
|
---|
138 | return;
|
---|
139 | if (primitive instanceof Node) {
|
---|
140 | nodes.remove(primitive);
|
---|
141 | } else if (primitive instanceof Way) {
|
---|
142 | ways.remove(primitive);
|
---|
143 | } else if (primitive instanceof Relation) {
|
---|
144 | relations.remove(primitive);
|
---|
145 | }
|
---|
146 | }
|
---|
147 |
|
---|
148 | public Collection<OsmPrimitive> getSelectedNodesAndWays() {
|
---|
149 | Collection<OsmPrimitive> sel = getSelected(nodes);
|
---|
150 | sel.addAll(getSelected(ways));
|
---|
151 | return sel;
|
---|
152 | }
|
---|
153 |
|
---|
154 |
|
---|
155 | /**
|
---|
156 | * Return a list of all selected objects. Even keys are returned.
|
---|
157 | * @return List of all selected objects.
|
---|
158 | */
|
---|
159 | public Collection<OsmPrimitive> getSelected() {
|
---|
160 | Collection<OsmPrimitive> sel = getSelected(nodes);
|
---|
161 | sel.addAll(getSelected(ways));
|
---|
162 | sel.addAll(getSelected(relations));
|
---|
163 | return sel;
|
---|
164 | }
|
---|
165 |
|
---|
166 | /**
|
---|
167 | * Return selected nodes.
|
---|
168 | */
|
---|
169 | public Collection<OsmPrimitive> getSelectedNodes() {
|
---|
170 | return getSelected(nodes);
|
---|
171 | }
|
---|
172 |
|
---|
173 | /**
|
---|
174 | * Return selected ways.
|
---|
175 | */
|
---|
176 | public Collection<OsmPrimitive> getSelectedWays() {
|
---|
177 | return getSelected(ways);
|
---|
178 | }
|
---|
179 |
|
---|
180 | /**
|
---|
181 | * Return selected relations.
|
---|
182 | */
|
---|
183 | public Collection<OsmPrimitive> getSelectedRelations() {
|
---|
184 | return getSelected(relations);
|
---|
185 | }
|
---|
186 |
|
---|
187 | public void setFiltered(Collection<? extends OsmPrimitive> selection) {
|
---|
188 | clearFiltered(nodes);
|
---|
189 | clearFiltered(ways);
|
---|
190 | clearFiltered(relations);
|
---|
191 | for (OsmPrimitive osm : selection) {
|
---|
192 | osm.setFiltered(true);
|
---|
193 | }
|
---|
194 | }
|
---|
195 |
|
---|
196 | public void setFiltered(OsmPrimitive... osm) {
|
---|
197 | if (osm.length == 1 && osm[0] == null) {
|
---|
198 | setFiltered();
|
---|
199 | return;
|
---|
200 | }
|
---|
201 | clearFiltered(nodes);
|
---|
202 | clearFiltered(ways);
|
---|
203 | clearFiltered(relations);
|
---|
204 | for (OsmPrimitive o : osm)
|
---|
205 | if (o != null) {
|
---|
206 | o.setFiltered(true);
|
---|
207 | }
|
---|
208 | }
|
---|
209 |
|
---|
210 | public void setDisabled(Collection<? extends OsmPrimitive> selection) {
|
---|
211 | clearDisabled(nodes);
|
---|
212 | clearDisabled(ways);
|
---|
213 | clearDisabled(relations);
|
---|
214 | for (OsmPrimitive osm : selection) {
|
---|
215 | osm.setDisabled(true);
|
---|
216 | }
|
---|
217 | }
|
---|
218 |
|
---|
219 | public void setDisabled(OsmPrimitive... osm) {
|
---|
220 | if (osm.length == 1 && osm[0] == null) {
|
---|
221 | setDisabled();
|
---|
222 | return;
|
---|
223 | }
|
---|
224 | clearDisabled(nodes);
|
---|
225 | clearDisabled(ways);
|
---|
226 | clearDisabled(relations);
|
---|
227 | for (OsmPrimitive o : osm)
|
---|
228 | if (o != null) {
|
---|
229 | o.setDisabled(true);
|
---|
230 | }
|
---|
231 | }
|
---|
232 |
|
---|
233 | public void setSelected(Collection<? extends OsmPrimitive> selection) {
|
---|
234 | clearSelection(nodes);
|
---|
235 | clearSelection(ways);
|
---|
236 | clearSelection(relations);
|
---|
237 | for (OsmPrimitive osm : selection) {
|
---|
238 | osm.setSelected(true);
|
---|
239 | }
|
---|
240 | fireSelectionChanged(selection);
|
---|
241 | }
|
---|
242 |
|
---|
243 | public void setSelected(OsmPrimitive... osm) {
|
---|
244 | if (osm.length == 1 && osm[0] == null) {
|
---|
245 | setSelected();
|
---|
246 | return;
|
---|
247 | }
|
---|
248 | clearSelection(nodes);
|
---|
249 | clearSelection(ways);
|
---|
250 | clearSelection(relations);
|
---|
251 | for (OsmPrimitive o : osm)
|
---|
252 | if (o != null) {
|
---|
253 | o.setSelected(true);
|
---|
254 | }
|
---|
255 | fireSelectionChanged(Arrays.asList(osm));
|
---|
256 | }
|
---|
257 |
|
---|
258 | /**
|
---|
259 | * Remove the filtered parameter from every value in the collection.
|
---|
260 | * @param list The collection to remove the filtered parameter from.
|
---|
261 | */
|
---|
262 | private void clearFiltered(Collection<? extends OsmPrimitive> list) {
|
---|
263 | if (list == null)
|
---|
264 | return;
|
---|
265 | for (OsmPrimitive osm : list) {
|
---|
266 | osm.setFiltered(false);
|
---|
267 | }
|
---|
268 | }
|
---|
269 | /**
|
---|
270 | * Remove the disabled parameter from every value in the collection.
|
---|
271 | * @param list The collection to remove the disabled parameter from.
|
---|
272 | */
|
---|
273 | private void clearDisabled(Collection<? extends OsmPrimitive> list) {
|
---|
274 | if (list == null)
|
---|
275 | return;
|
---|
276 | for (OsmPrimitive osm : list) {
|
---|
277 | osm.setDisabled(false);
|
---|
278 | }
|
---|
279 | }
|
---|
280 |
|
---|
281 | /**
|
---|
282 | * Remove the selection from every value in the collection.
|
---|
283 | * @param list The collection to remove the selection from.
|
---|
284 | */
|
---|
285 | private void clearSelection(Collection<? extends OsmPrimitive> list) {
|
---|
286 | if (list == null)
|
---|
287 | return;
|
---|
288 | for (OsmPrimitive osm : list) {
|
---|
289 | osm.setSelected(false);
|
---|
290 | }
|
---|
291 | }
|
---|
292 |
|
---|
293 | /**
|
---|
294 | * Return all selected items in the collection.
|
---|
295 | * @param list The collection from which the selected items are returned.
|
---|
296 | */
|
---|
297 | private Collection<OsmPrimitive> getSelected(Collection<? extends OsmPrimitive> list) {
|
---|
298 | Collection<OsmPrimitive> sel = new HashSet<OsmPrimitive>();
|
---|
299 | if (list == null)
|
---|
300 | return sel;
|
---|
301 | for (OsmPrimitive osm : list)
|
---|
302 | if (osm.isSelected() && !osm.isDeleted()) {
|
---|
303 | sel.add(osm);
|
---|
304 | }
|
---|
305 | return sel;
|
---|
306 | }
|
---|
307 |
|
---|
308 | /**
|
---|
309 | * Remember to fire an selection changed event. A call to this will not fire the event
|
---|
310 | * immediately. For more,
|
---|
311 | * @see SelectionChangedListener
|
---|
312 | */
|
---|
313 | public static void fireSelectionChanged(Collection<? extends OsmPrimitive> sel) {
|
---|
314 | for (SelectionChangedListener l : selListeners) {
|
---|
315 | l.selectionChanged(sel);
|
---|
316 | }
|
---|
317 | }
|
---|
318 |
|
---|
319 | @Override public DataSet clone() {
|
---|
320 | DataSet ds = new DataSet();
|
---|
321 | for (Node n : nodes) {
|
---|
322 | ds.nodes.add(new Node(n));
|
---|
323 | }
|
---|
324 | for (Way w : ways) {
|
---|
325 | ds.ways.add(new Way(w));
|
---|
326 | }
|
---|
327 | for (Relation e : relations) {
|
---|
328 | ds.relations.add(new Relation(e));
|
---|
329 | }
|
---|
330 | for (DataSource source : dataSources) {
|
---|
331 | ds.dataSources.add(new DataSource(source.bounds, source.origin));
|
---|
332 | }
|
---|
333 | ds.version = version;
|
---|
334 | return ds;
|
---|
335 | }
|
---|
336 |
|
---|
337 | /**
|
---|
338 | * Returns the total area of downloaded data (the "yellow rectangles").
|
---|
339 | * @return Area object encompassing downloaded data.
|
---|
340 | */
|
---|
341 | public Area getDataSourceArea() {
|
---|
342 | if (dataSources.isEmpty()) return null;
|
---|
343 | Area a = new Area();
|
---|
344 | for (DataSource source : dataSources) {
|
---|
345 | // create area from data bounds
|
---|
346 | a.add(new Area(source.bounds.asRect()));
|
---|
347 | }
|
---|
348 | return a;
|
---|
349 | }
|
---|
350 |
|
---|
351 | // Provide well-defined sorting for collections of OsmPrimitives.
|
---|
352 | // FIXME: probably not a good place to put this code.
|
---|
353 | public static OsmPrimitive[] sort(Collection<? extends OsmPrimitive> list) {
|
---|
354 | OsmPrimitive[] selArr = new OsmPrimitive[list.size()];
|
---|
355 | final HashMap<Object, String> h = new HashMap<Object, String>();
|
---|
356 | selArr = list.toArray(selArr);
|
---|
357 | Arrays.sort(selArr, new Comparator<OsmPrimitive>() {
|
---|
358 | public int compare(OsmPrimitive a, OsmPrimitive b) {
|
---|
359 | if (a.getClass() == b.getClass()) {
|
---|
360 | String as = h.get(a);
|
---|
361 | if (as == null) {
|
---|
362 | as = a.getName() != null ? a.getName() : Long.toString(a.getId());
|
---|
363 | h.put(a, as);
|
---|
364 | }
|
---|
365 | String bs = h.get(b);
|
---|
366 | if (bs == null) {
|
---|
367 | bs = b.getName() != null ? b.getName() : Long.toString(b.getId());
|
---|
368 | h.put(b, bs);
|
---|
369 | }
|
---|
370 | int res = as.compareTo(bs);
|
---|
371 | if (res != 0)
|
---|
372 | return res;
|
---|
373 | }
|
---|
374 | return a.compareTo(b);
|
---|
375 | }
|
---|
376 | });
|
---|
377 | return selArr;
|
---|
378 | }
|
---|
379 |
|
---|
380 | /**
|
---|
381 | * returns a primitive with a given id from the data set. null, if no such primitive
|
---|
382 | * exists
|
---|
383 | *
|
---|
384 | * @param id the id, > 0 required
|
---|
385 | * @param type the type of the primitive. Must not be null.
|
---|
386 | * @return the primitive
|
---|
387 | * @exception IllegalArgumentException thrown, if id <= 0
|
---|
388 | * @exception IllegalArgumentException thrown, if type is null
|
---|
389 | * @exception IllegalArgumentException thrown, if type is neither NODE, or WAY or RELATION
|
---|
390 | */
|
---|
391 | public OsmPrimitive getPrimitiveById(long id, OsmPrimitiveType type) {
|
---|
392 | if (id <= 0)
|
---|
393 | throw new IllegalArgumentException(tr("Parameter ''{0}'' > 0 expected. Got ''{1}''.", "id", id));
|
---|
394 | if (id <= 0)
|
---|
395 | throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "type"));
|
---|
396 | Collection<? extends OsmPrimitive> primitives = null;
|
---|
397 | switch(type) {
|
---|
398 | case NODE: primitives = nodes; break;
|
---|
399 | case WAY: primitives = ways; break;
|
---|
400 | case RELATION: primitives = relations; break;
|
---|
401 | }
|
---|
402 | for (OsmPrimitive primitive : primitives) {
|
---|
403 | if (primitive.getId() == id) return primitive;
|
---|
404 | }
|
---|
405 | return null;
|
---|
406 | }
|
---|
407 |
|
---|
408 | public Set<Long> getPrimitiveIds() {
|
---|
409 | HashSet<Long> ret = new HashSet<Long>();
|
---|
410 | for (OsmPrimitive primitive : nodes) {
|
---|
411 | ret.add(primitive.getId());
|
---|
412 | }
|
---|
413 | for (OsmPrimitive primitive : ways) {
|
---|
414 | ret.add(primitive.getId());
|
---|
415 | }
|
---|
416 | for (OsmPrimitive primitive : relations) {
|
---|
417 | ret.add(primitive.getId());
|
---|
418 | }
|
---|
419 | return ret;
|
---|
420 | }
|
---|
421 |
|
---|
422 | protected void deleteWay(Way way) {
|
---|
423 | way.setNodes(null);
|
---|
424 | way.setDeleted(true);
|
---|
425 | }
|
---|
426 |
|
---|
427 | /**
|
---|
428 | * removes all references from ways in this dataset to a particular node
|
---|
429 | *
|
---|
430 | * @param node the node
|
---|
431 | */
|
---|
432 | public void unlinkNodeFromWays(Node node) {
|
---|
433 | for (Way way: ways) {
|
---|
434 | List<Node> nodes = way.getNodes();
|
---|
435 | if (nodes.remove(node)) {
|
---|
436 | if (nodes.size() < 2) {
|
---|
437 | deleteWay(way);
|
---|
438 | } else {
|
---|
439 | way.setNodes(nodes);
|
---|
440 | }
|
---|
441 | }
|
---|
442 | }
|
---|
443 | }
|
---|
444 |
|
---|
445 | /**
|
---|
446 | * removes all references from relations in this dataset to this primitive
|
---|
447 | *
|
---|
448 | * @param primitive the primitive
|
---|
449 | */
|
---|
450 | public void unlinkPrimitiveFromRelations(OsmPrimitive primitive) {
|
---|
451 | for (Relation relation : relations) {
|
---|
452 | Iterator<RelationMember> it = relation.getMembers().iterator();
|
---|
453 | while(it.hasNext()) {
|
---|
454 | RelationMember member = it.next();
|
---|
455 | if (member.getMember().equals(primitive)) {
|
---|
456 | it.remove();
|
---|
457 | }
|
---|
458 | }
|
---|
459 | }
|
---|
460 | }
|
---|
461 |
|
---|
462 | /**
|
---|
463 | * removes all references from from other primitives to the
|
---|
464 | * referenced primitive
|
---|
465 | *
|
---|
466 | * @param referencedPrimitive the referenced primitive
|
---|
467 | */
|
---|
468 | public void unlinkReferencesToPrimitive(OsmPrimitive referencedPrimitive) {
|
---|
469 | if (referencedPrimitive instanceof Node) {
|
---|
470 | unlinkNodeFromWays((Node)referencedPrimitive);
|
---|
471 | unlinkPrimitiveFromRelations(referencedPrimitive);
|
---|
472 | } else {
|
---|
473 | unlinkPrimitiveFromRelations(referencedPrimitive);
|
---|
474 | }
|
---|
475 | }
|
---|
476 |
|
---|
477 | /**
|
---|
478 | * Replies a list of parent relations which refer to the relation
|
---|
479 | * <code>child</code>. Replies an empty list if child is null.
|
---|
480 | *
|
---|
481 | * @param child the child relation
|
---|
482 | * @return a list of parent relations which refer to the relation
|
---|
483 | * <code>child</code>
|
---|
484 | */
|
---|
485 | public List<Relation> getParentRelations(Relation child) {
|
---|
486 | ArrayList<Relation> parents = new ArrayList<Relation>();
|
---|
487 | if (child == null)
|
---|
488 | return parents;
|
---|
489 | for (Relation parent : relations) {
|
---|
490 | if (parent == child) {
|
---|
491 | continue;
|
---|
492 | }
|
---|
493 | for (RelationMember member: parent.getMembers()) {
|
---|
494 | if (member.refersTo(child)) {
|
---|
495 | parents.add(parent);
|
---|
496 | break;
|
---|
497 | }
|
---|
498 | }
|
---|
499 | }
|
---|
500 | return parents;
|
---|
501 | }
|
---|
502 |
|
---|
503 | /**
|
---|
504 | * Replies true if there is at least one primitive in this dataset with
|
---|
505 | * {@see OsmPrimitive#isModified()} == <code>true</code>.
|
---|
506 | *
|
---|
507 | * @return true if there is at least one primitive in this dataset with
|
---|
508 | * {@see OsmPrimitive#isModified()} == <code>true</code>.
|
---|
509 | */
|
---|
510 | public boolean isModified() {
|
---|
511 | for (Node n: nodes) {
|
---|
512 | if (n.isModified()) return true;
|
---|
513 | }
|
---|
514 | for (Way w: ways) {
|
---|
515 | if (w.isModified()) return true;
|
---|
516 | }
|
---|
517 | for (Relation r: relations) {
|
---|
518 | if (r.isModified()) return true;
|
---|
519 | }
|
---|
520 | return false;
|
---|
521 | }
|
---|
522 |
|
---|
523 | public Set<Relation> getReferringRelations(Collection<? extends OsmPrimitive> primitives) {
|
---|
524 | HashSet<Relation> ret = new HashSet<Relation>();
|
---|
525 | if (primitives == null) return ret;
|
---|
526 | Set<? extends OsmPrimitive> referred;
|
---|
527 | if (primitives instanceof Set<?>) {
|
---|
528 | referred = (Set<? extends OsmPrimitive>)primitives;
|
---|
529 | } else {
|
---|
530 | referred = new HashSet<OsmPrimitive>(primitives);
|
---|
531 | }
|
---|
532 | referred.remove(null); // just in case - remove null element from primitives
|
---|
533 | for (Relation r: relations) {
|
---|
534 | if (r.isDeleted() || r.incomplete) {
|
---|
535 | continue;
|
---|
536 | }
|
---|
537 | Set<OsmPrimitive> memberPrimitives = r.getMemberPrimitives();
|
---|
538 | memberPrimitives.retainAll(referred);
|
---|
539 | if (!memberPrimitives.isEmpty()) {
|
---|
540 | ret.add(r);
|
---|
541 | }
|
---|
542 | }
|
---|
543 | return ret;
|
---|
544 | }
|
---|
545 | }
|
---|