public class TemporaryMap
extends java.lang.Object
Constructor and Description |
---|
TemporaryMap(OSMMap osmMap)
Construct a TemporaryMap.
|
Modifier and Type | Method and Description |
---|---|
void |
addBuilding(TemporaryBuilding building)
Add a building.
|
void |
addIntersection(TemporaryIntersection intersection)
Add an intersection.
|
void |
addRoad(TemporaryRoad road)
Add a road.
|
void |
addTemporaryObject(TemporaryObject object)
Add an object.
|
java.util.Collection<Edge> |
getAllEdges()
Get all edges in the map.
|
java.util.Collection<Node> |
getAllNodes()
Get all nodes in the map.
|
java.util.Collection<TemporaryObject> |
getAllObjects()
Get all objects in the map.
|
java.util.Set<Edge> |
getAttachedEdges(Node n)
Get all edges attached to a Node.
|
java.util.Set<TemporaryObject> |
getAttachedObjects(Edge e)
Get all objects attached to an Edge.
|
java.util.Collection<TemporaryBuilding> |
getBuildings()
Get all buildings in the map.
|
DirectedEdge |
getDirectedEdge(Node from,
Node to)
Get a DirectedEdge between two nodes.
|
Edge |
getEdge(Node from,
Node to)
Get an Edge between two nodes.
|
java.util.Collection<TemporaryIntersection> |
getIntersections()
Get all intersections in the map.
|
double |
getNearbyThreshold()
Get the threshold for deciding if two points are the same.
|
Node |
getNode(double x,
double y)
Get a Node near a point.
|
Node |
getNode(Point2D p)
Get a Node near a point.
|
java.util.Collection<OSMBuildingInfo> |
getOSMBuildingInfo()
Get the OSM building info.
|
java.util.Collection<OSMIntersectionInfo> |
getOSMIntersectionInfo()
Get the OSM intersection info.
|
OSMMap |
getOSMMap()
Get the OSMMap.
|
java.util.Collection<OSMRoadInfo> |
getOSMRoadInfo()
Get the OSM road info.
|
java.util.Collection<TemporaryRoad> |
getRoads()
Get all roads in the map.
|
boolean |
isNear(double x1,
double y1,
double x2,
double y2)
Find out if two points are nearby.
|
boolean |
isNear(Point2D point1,
Point2D point2)
Find out if two points are nearby.
|
void |
removeBuilding(TemporaryBuilding building)
Remove a building.
|
void |
removeIntersection(TemporaryIntersection intersection)
Remove an intersection.
|
void |
removeRoad(TemporaryRoad road)
Remove a road.
|
void |
removeTemporaryObject(TemporaryObject object)
Remove an object.
|
void |
replaceEdge(Edge edge,
java.util.Collection<Edge> newEdges)
Replace an existing edge with a set of new edges.
|
void |
setNearbyThreshold(double t)
Set the threshold for deciding if two points are the same.
|
void |
setOSMInfo(java.util.Collection<OSMIntersectionInfo> intersections,
java.util.Collection<OSMRoadInfo> roads,
java.util.Collection<OSMBuildingInfo> buildings)
Set the OSMMap information.
|
java.util.List<Edge> |
splitEdge(Edge edge,
Node... splitPoints)
Split an edge into chunks.
|
public TemporaryMap(OSMMap osmMap)
osmMap
- The OpenStreetMap data this map is generated from.public OSMMap getOSMMap()
public void setOSMInfo(java.util.Collection<OSMIntersectionInfo> intersections, java.util.Collection<OSMRoadInfo> roads, java.util.Collection<OSMBuildingInfo> buildings)
intersections
- The set of intersections.roads
- The set of roads.buildings
- The set of buildings.public java.util.Collection<OSMIntersectionInfo> getOSMIntersectionInfo()
public java.util.Collection<OSMRoadInfo> getOSMRoadInfo()
public java.util.Collection<OSMBuildingInfo> getOSMBuildingInfo()
public void addRoad(TemporaryRoad road)
road
- The road to add.public void removeRoad(TemporaryRoad road)
road
- The road to remove.public void addIntersection(TemporaryIntersection intersection)
intersection
- The intersection to add.public void removeIntersection(TemporaryIntersection intersection)
intersection
- The intersection to remove.public void addBuilding(TemporaryBuilding building)
building
- The building to add.public void removeBuilding(TemporaryBuilding building)
building
- The building to remove.public void addTemporaryObject(TemporaryObject object)
object
- The object to add.public void removeTemporaryObject(TemporaryObject object)
object
- The object to remove.public java.util.Collection<TemporaryRoad> getRoads()
public java.util.Collection<TemporaryIntersection> getIntersections()
public java.util.Collection<TemporaryBuilding> getBuildings()
public java.util.Collection<TemporaryObject> getAllObjects()
public java.util.Collection<Node> getAllNodes()
public java.util.Collection<Edge> getAllEdges()
public java.util.Set<TemporaryObject> getAttachedObjects(Edge e)
e
- The Edge.public java.util.Set<Edge> getAttachedEdges(Node n)
n
- The Node.public void setNearbyThreshold(double t)
isNear(Point2D, Point2D)
method uses this value to check if a new point needs to be registered.t
- The new threshold.public double getNearbyThreshold()
isNear(Point2D, Point2D)
method uses this value to check if a new point needs to be registered.public boolean isNear(Point2D point1, Point2D point2)
point1
- The first point.point2
- The second point.public boolean isNear(double x1, double y1, double x2, double y2)
x1
- The x coordinate of the first point.y1
- The y coordinate of the first point.x2
- The x coordinate of the second point.y2
- The y coordinate of the second point.public Node getNode(Point2D p)
p
- The node coordinates.public Node getNode(double x, double y)
x
- The X coordinate.y
- The Y coordinate.public Edge getEdge(Node from, Node to)
from
- The from node.to
- The to node.public DirectedEdge getDirectedEdge(Node from, Node to)
from
- The from node.to
- The to node.public void replaceEdge(Edge edge, java.util.Collection<Edge> newEdges)
edge
- The old edge.newEdges
- The new edges.