public void process(EntityContainer entityContainer) { Entity entity = entityContainer.getEntity(); if (entity instanceof Node) { nodesById.put(entity.getId(), ((Node) entity)); } else if (entity instanceof Way) { waysById.put(entity.getId(), ((Way) entity)); } else if (entity instanceof Relation) { relationsById.put(entity.getId(), ((Relation) entity)); } else if (entity instanceof Bound) { bounds.add((Bound) entity); } }
/** * Checks whether the Entity in a container has tags that match this filter. * * @param container The container holding the entity whose tags shall be examined. */ private boolean matches(EntityContainer container) { boolean matched = false; for (Tag tag : container.getEntity().getTags()) { String key = tag.getKey(); if (tagKeys.contains(key)) { matched = true; break; } Set<String> values = tagKeyValues.get(key); if ((values != null) && values.contains(tag.getValue())) { matched = true; break; } } return matched; }