use of de.topobyte.osm4j.core.model.iface.OsmRelation in project osm4j-core by topobyte.
the class EntityFinderIgnoreMissing method findMemberRelationsRecursively.
private void findMemberRelationsRecursively(Deque<OsmRelation> queue, Set<OsmRelation> outRelations) {
TLongSet ids = new TLongHashSet();
while (!queue.isEmpty()) {
OsmRelation relation = queue.remove();
for (OsmRelationMember member : OsmModelUtil.membersAsList(relation)) {
if (member.getType() != EntityType.Relation) {
continue;
}
long id = member.getId();
if (ids.contains(id)) {
continue;
}
ids.add(id);
try {
OsmRelation child = entityProvider.getRelation(id);
outRelations.add(child);
queue.add(child);
} catch (EntityNotFoundException e) {
// ignore silently
}
}
}
}
use of de.topobyte.osm4j.core.model.iface.OsmRelation in project osm4j-core by topobyte.
the class EntityFinderLogMissing method findMemberRelationsRecursively.
private void findMemberRelationsRecursively(Deque<OsmRelation> queue, Set<OsmRelation> outRelations) {
TLongSet ids = new TLongHashSet();
while (!queue.isEmpty()) {
OsmRelation relation = queue.remove();
for (OsmRelationMember member : OsmModelUtil.membersAsList(relation)) {
if (member.getType() != EntityType.Relation) {
continue;
}
long id = member.getId();
if (ids.contains(id)) {
continue;
}
ids.add(id);
try {
OsmRelation child = entityProvider.getRelation(id);
outRelations.add(child);
queue.add(child);
} catch (EntityNotFoundException e) {
logRelationNotFound(id);
}
}
}
}
use of de.topobyte.osm4j.core.model.iface.OsmRelation in project osm4j-core by topobyte.
the class EntityFinderLogMissing method findRelations.
@Override
public List<OsmRelation> findRelations(TLongCollection ids) {
List<OsmRelation> relations = new ArrayList<>();
TLongIterator idIterator = ids.iterator();
while (idIterator.hasNext()) {
long id = idIterator.next();
try {
relations.add(entityProvider.getRelation(id));
} catch (EntityNotFoundException e) {
logRelationNotFound(id);
}
}
return relations;
}
use of de.topobyte.osm4j.core.model.iface.OsmRelation in project osm4j-core by topobyte.
the class EntityFinderThrowMissing method findRelations.
@Override
public List<OsmRelation> findRelations(TLongCollection ids) throws EntityNotFoundException {
List<OsmRelation> relations = new ArrayList<>();
TLongIterator idIterator = ids.iterator();
while (idIterator.hasNext()) {
relations.add(entityProvider.getRelation(idIterator.next()));
}
return relations;
}
use of de.topobyte.osm4j.core.model.iface.OsmRelation in project osm4j-core by topobyte.
the class EntityFinderThrowMissing method findMemberRelationsRecursively.
private void findMemberRelationsRecursively(Deque<OsmRelation> queue, Set<OsmRelation> outRelations) throws EntityNotFoundException {
TLongSet ids = new TLongHashSet();
while (!queue.isEmpty()) {
OsmRelation relation = queue.remove();
for (OsmRelationMember member : OsmModelUtil.membersAsList(relation)) {
if (member.getType() != EntityType.Relation) {
continue;
}
long id = member.getId();
if (ids.contains(id)) {
continue;
}
ids.add(id);
OsmRelation child = entityProvider.getRelation(id);
outRelations.add(child);
queue.add(child);
}
}
}
Aggregations