Class AllNodesVisitor
java.lang.Object
org.openstreetmap.josm.data.osm.visitor.AllNodesVisitor
- All Implemented Interfaces:
OsmPrimitiveVisitor
Collect all nodes a specific osm primitive has.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<Node>getAllNodes(Collection<? extends OsmPrimitive> osms) Replies all nodes contained by the given primitivesvoidNodes have only itself as nodes.voidRelations may have any number of nodes.voidWays have their way nodes.
-
Field Details
-
nodes
The resulting nodes collected so far.
-
-
Constructor Details
-
AllNodesVisitor
public AllNodesVisitor()
-
-
Method Details
-
visit
Nodes have only itself as nodes.- Specified by:
visitin interfaceOsmPrimitiveVisitor- Parameters:
n- The node to inspect.
-
visit
Ways have their way nodes.- Specified by:
visitin interfaceOsmPrimitiveVisitor- Parameters:
w- The way to inspect.
-
visit
Relations may have any number of nodes. FIXME: do we want to collect nodes from segs/ways that are relation members? if so, use AutomatchVisitor!- Specified by:
visitin interfaceOsmPrimitiveVisitor- Parameters:
e- The relation to inspect.
-
getAllNodes
Replies all nodes contained by the given primitives- Parameters:
osms- The OSM primitives to inspect- Returns:
- All nodes the given primitives have.
-