Package org.openstreetmap.josm.data.osm
Class QuadBucketPrimitiveStore<N extends INode,W extends IWay<N>,R extends IRelation<?>>
java.lang.Object
org.openstreetmap.josm.data.osm.QuadBucketPrimitiveStore<N,W,R>
- Type Parameters:
N- type representing OSM nodesW- type representing OSM waysR- type representing OSM relations
- Direct Known Subclasses:
DataStore.LocalQuadBucketPrimitiveStore
public class QuadBucketPrimitiveStore<N extends INode,W extends IWay<N>,R extends IRelation<?>>
extends Object
Stores primitives in quad buckets. This can be used to hold a collection of primitives, e.g. in a
DataSet
This class does not do any synchronization.- Since:
- 12048
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final QuadBuckets<N>All nodes goes here, even when included in other data (ways etc).private final Collection<R>All relations/relationshipsprivate final QuadBuckets<W>All ways (Streets etc.) in the DataSet. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPrimitive(IPrimitive primitive) Adds a primitive to this quad bucket storevoidclear()Removes all primitives from the this store.booleancontainsNode(N n) Determines if the given node can be retrieved in the store through its bounding box.booleanDetermines if the given relation can be retrieved in the store through its bounding box.booleancontainsWay(W w) Determines if the given way can be retrieved in the store through its bounding box.protected voidRe-index the node after it's position was changed.protected voidreindexRelation(R relation, Consumer<R> rUpdater) Re-index the relation after it's position was changed.protected voidRe-index the way after it's position was changed.protected voidremovePrimitive(IPrimitive primitive) searchNodes(BBox bbox) Searches for nodes in the given bounding box.searchRelations(BBox bbox) Searches for relations in the given bounding box.searchWays(BBox bbox) Searches for ways in the given bounding box.
-
Field Details
-
nodes
All nodes goes here, even when included in other data (ways etc). This enables the instant conversion of the whole DataSet by iterating over this data structure. -
ways
All ways (Streets etc.) in the DataSet. The way nodes are stored only in the way list. -
relations
All relations/relationships
-
-
Constructor Details
-
QuadBucketPrimitiveStore
public QuadBucketPrimitiveStore()
-
-
Method Details
-
searchNodes
Searches for nodes in the given bounding box.- Parameters:
bbox- the bounding box- Returns:
- List of nodes in the given bbox. Can be empty but not null
-
containsNode
Determines if the given node can be retrieved in the store through its bounding box. Useful for dataset consistency test.- Parameters:
n- The node to search- Returns:
trueifncan be retrieved in this store,falseotherwise
-
searchWays
Searches for ways in the given bounding box.- Parameters:
bbox- the bounding box- Returns:
- List of ways in the given bbox. Can be empty but not null
-
containsWay
Determines if the given way can be retrieved in the store through its bounding box. Useful for dataset consistency test.- Parameters:
w- The way to search- Returns:
trueifwcan be retrieved in this store,falseotherwise
-
searchRelations
Searches for relations in the given bounding box.- Parameters:
bbox- the bounding box- Returns:
- List of relations in the given bbox. Can be empty but not null
-
containsRelation
Determines if the given relation can be retrieved in the store through its bounding box. Useful for dataset consistency test.- Parameters:
r- The relation to search- Returns:
trueifrcan be retrieved in this store,falseotherwise
-
addPrimitive
Adds a primitive to this quad bucket store- Parameters:
primitive- the primitive.
-
removePrimitive
-
reindexNode
protected void reindexNode(N node, Consumer<N> nUpdater, Consumer<W> wUpdater, Consumer<R> rUpdater) Re-index the node after it's position was changed.- Parameters:
node- The node to re-indexnUpdater- update node positionwUpdater- update way positionrUpdater- update relation position
-
reindexWay
Re-index the way after it's position was changed.- Parameters:
way- The way to re-indexwUpdater- update way positionrUpdater- update relation position
-
reindexRelation
Re-index the relation after it's position was changed.- Parameters:
relation- The relation to re-indexrUpdater- update relation position
-
clear
Removes all primitives from the this store.
-