N - type representing OSM nodesW - type representing OSM waysR - type representing OSM relationspublic class QuadBucketPrimitiveStore<N extends INode,W extends IWay<N>,R extends IRelation<?>> extends java.lang.Object
DataSet
This class does not do any synchronization.| Modifier and Type | Field and Description |
|---|---|
private QuadBuckets<N> |
nodes
All nodes goes here, even when included in other data (ways etc).
|
private java.util.Collection<R> |
relations
All relations/relationships
|
private QuadBuckets<W> |
ways
All ways (Streets etc.) in the DataSet.
|
| Constructor and Description |
|---|
QuadBucketPrimitiveStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPrimitive(IPrimitive primitive)
Adds a primitive to this quad bucket store
|
void |
clear()
Removes all primitives from the this store.
|
boolean |
containsNode(N n)
Determines if the given node can be retrieved in the store through its bounding box.
|
boolean |
containsRelation(R r)
Determines if the given relation can be retrieved in the store through its bounding box.
|
boolean |
containsWay(W w)
Determines if the given way can be retrieved in the store through its bounding box.
|
protected void |
reindexNode(N node,
java.util.function.Consumer<N> nUpdater,
java.util.function.Consumer<W> wUpdater,
java.util.function.Consumer<R> rUpdater)
Re-index the node after it's position was changed.
|
protected void |
reindexRelation(R relation,
java.util.function.Consumer<R> rUpdater)
Re-index the relation after it's position was changed.
|
protected void |
reindexWay(W way,
java.util.function.Consumer<W> wUpdater,
java.util.function.Consumer<R> rUpdater)
Re-index the way after it's position was changed.
|
protected void |
removePrimitive(IPrimitive primitive) |
java.util.List<N> |
searchNodes(BBox bbox)
Searches for nodes in the given bounding box.
|
java.util.List<R> |
searchRelations(BBox bbox)
Searches for relations in the given bounding box.
|
java.util.List<W> |
searchWays(BBox bbox)
Searches for ways in the given bounding box.
|
private final QuadBuckets<N extends INode> nodes
private final QuadBuckets<W extends IWay<N>> ways
public QuadBucketPrimitiveStore()
public java.util.List<N> searchNodes(BBox bbox)
bbox - the bounding boxpublic boolean containsNode(N n)
n - The node to searchtrue if n can be retrieved in this store, false otherwisepublic java.util.List<W> searchWays(BBox bbox)
bbox - the bounding boxpublic boolean containsWay(W w)
w - The way to searchtrue if w can be retrieved in this store, false otherwisepublic java.util.List<R> searchRelations(BBox bbox)
bbox - the bounding boxpublic boolean containsRelation(R r)
r - The relation to searchtrue if r can be retrieved in this store, false otherwisepublic void addPrimitive(IPrimitive primitive)
primitive - the primitive.protected void removePrimitive(IPrimitive primitive)
protected void reindexNode(N node, java.util.function.Consumer<N> nUpdater, java.util.function.Consumer<W> wUpdater, java.util.function.Consumer<R> rUpdater)
node - The node to re-indexnUpdater - update node positionwUpdater - update way positionrUpdater - update relation positionprotected void reindexWay(W way, java.util.function.Consumer<W> wUpdater, java.util.function.Consumer<R> rUpdater)
way - The way to re-indexwUpdater - update way positionrUpdater - update relation positionprotected void reindexRelation(R relation, java.util.function.Consumer<R> rUpdater)
relation - The relation to re-indexrUpdater - update relation positionpublic void clear()