Search in sources :

Example 6 with TLongIterator

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

the class EntityFinderLogMissing method findNodes.

@Override
public List<OsmNode> findNodes(TLongCollection ids) throws EntityNotFoundException {
    List<OsmNode> nodes = new ArrayList<>();
    TLongIterator idIterator = ids.iterator();
    while (idIterator.hasNext()) {
        long id = idIterator.next();
        try {
            nodes.add(entityProvider.getNode(id));
        } catch (EntityNotFoundException e) {
            logNodeNotFound(id);
        }
    }
    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 7 with TLongIterator

use of com.slimjars.dist.gnu.trove.iterator.TLongIterator 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;
}
Also used : OsmRelation(de.topobyte.osm4j.core.model.iface.OsmRelation) ArrayList(java.util.ArrayList) TLongIterator(com.slimjars.dist.gnu.trove.iterator.TLongIterator)

Example 8 with TLongIterator

use of com.slimjars.dist.gnu.trove.iterator.TLongIterator 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;
}
Also used : OsmRelation(de.topobyte.osm4j.core.model.iface.OsmRelation) ArrayList(java.util.ArrayList) TLongIterator(com.slimjars.dist.gnu.trove.iterator.TLongIterator)

Example 9 with TLongIterator

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

the class EntityFinderThrowMissing method findWays.

@Override
public List<OsmWay> findWays(TLongCollection ids) throws EntityNotFoundException {
    List<OsmWay> ways = new ArrayList<>();
    TLongIterator idIterator = ids.iterator();
    while (idIterator.hasNext()) {
        ways.add(entityProvider.getWay(idIterator.next()));
    }
    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 10 with TLongIterator

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

the class IdUtil method lowestId.

public static long lowestId(TLongCollection ids) {
    long lowest = Long.MAX_VALUE;
    TLongIterator iterator = ids.iterator();
    while (iterator.hasNext()) {
        lowest = Math.min(lowest, iterator.next());
    }
    return lowest;
}
Also used : 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