Search in sources :

Example 1 with TLongIterator

use of com.slimjars.dist.gnu.trove.iterator.TLongIterator in project osm4j-core by topobyte.

the class EntityFinderIgnoreMissing method findNodes.

@Override
public List<OsmNode> findNodes(TLongCollection ids) throws EntityNotFoundException {
    List<OsmNode> nodes = new ArrayList<>();
    TLongIterator idIterator = ids.iterator();
    while (idIterator.hasNext()) {
        try {
            nodes.add(entityProvider.getNode(idIterator.next()));
        } catch (EntityNotFoundException e) {
        // ignore silently
        }
    }
    return nodes;
}
Also used : OsmNode(de.topobyte.osm4j.core.model.iface.OsmNode) ArrayList(java.util.ArrayList) TLongIterator(com.slimjars.dist.gnu.trove.iterator.TLongIterator)

Example 2 with TLongIterator

use of com.slimjars.dist.gnu.trove.iterator.TLongIterator in project osm4j-core by topobyte.

the class EntityFinderLogMissing method findWays.

@Override
public List<OsmWay> findWays(TLongCollection ids) throws EntityNotFoundException {
    List<OsmWay> ways = new ArrayList<>();
    TLongIterator idIterator = ids.iterator();
    while (idIterator.hasNext()) {
        long id = idIterator.next();
        try {
            ways.add(entityProvider.getWay(id));
        } catch (EntityNotFoundException e) {
            logWayNotFound(id);
        }
    }
    return ways;
}
Also used : OsmWay(de.topobyte.osm4j.core.model.iface.OsmWay) ArrayList(java.util.ArrayList) TLongIterator(com.slimjars.dist.gnu.trove.iterator.TLongIterator)

Example 3 with TLongIterator

use of com.slimjars.dist.gnu.trove.iterator.TLongIterator in project osm4j-core by topobyte.

the class EntityFinderThrowMissing method findNodes.

@Override
public List<OsmNode> findNodes(TLongCollection ids) throws EntityNotFoundException {
    List<OsmNode> nodes = new ArrayList<>();
    TLongIterator idIterator = ids.iterator();
    while (idIterator.hasNext()) {
        nodes.add(entityProvider.getNode(idIterator.next()));
    }
    return nodes;
}
Also used : OsmNode(de.topobyte.osm4j.core.model.iface.OsmNode) ArrayList(java.util.ArrayList) TLongIterator(com.slimjars.dist.gnu.trove.iterator.TLongIterator)

Example 4 with TLongIterator

use of com.slimjars.dist.gnu.trove.iterator.TLongIterator in project osm4j-core by topobyte.

the class EntityFinderIgnoreMissing method findWays.

@Override
public List<OsmWay> findWays(TLongCollection ids) throws EntityNotFoundException {
    List<OsmWay> ways = new ArrayList<>();
    TLongIterator idIterator = ids.iterator();
    while (idIterator.hasNext()) {
        try {
            ways.add(entityProvider.getWay(idIterator.next()));
        } catch (EntityNotFoundException e) {
        // ignore silently
        }
    }
    return ways;
}
Also used : OsmWay(de.topobyte.osm4j.core.model.iface.OsmWay) ArrayList(java.util.ArrayList) TLongIterator(com.slimjars.dist.gnu.trove.iterator.TLongIterator)

Example 5 with TLongIterator

use of com.slimjars.dist.gnu.trove.iterator.TLongIterator in project osm4j-core by topobyte.

the class EntityFinderIgnoreMissing method findRelations.

@Override
public List<OsmRelation> findRelations(TLongCollection ids) {
    List<OsmRelation> relations = new ArrayList<>();
    TLongIterator idIterator = ids.iterator();
    while (idIterator.hasNext()) {
        try {
            relations.add(entityProvider.getRelation(idIterator.next()));
        } catch (EntityNotFoundException e) {
        // ignore silently
        }
    }
    return relations;
}
Also used : OsmRelation(de.topobyte.osm4j.core.model.iface.OsmRelation) ArrayList(java.util.ArrayList) TLongIterator(com.slimjars.dist.gnu.trove.iterator.TLongIterator)

Aggregations

TLongIterator (com.slimjars.dist.gnu.trove.iterator.TLongIterator)10 ArrayList (java.util.ArrayList)9 OsmNode (de.topobyte.osm4j.core.model.iface.OsmNode)3 OsmRelation (de.topobyte.osm4j.core.model.iface.OsmRelation)3 OsmWay (de.topobyte.osm4j.core.model.iface.OsmWay)3