public final class Convert extends Object
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2015-09-16 19:20:07 +0200 (Wed, 16 Sep 2015) $, @version $Revision: 1405 $, by $Author: averbraeck $,
initial version 30.12.2014
Constructor and Description |
---|
Convert()
Construct a converter.
|
Modifier and Type | Method and Description |
---|---|
CrossSectionLink |
convertLink(OTSRoadNetwork network,
OSMLink link,
OTSSimulatorInterface simulator)
This method converts an OSM link to an OTS link.
|
OTSNode |
convertNode(OTSRoadNetwork network,
OSMNode node)
This method converts an OSM node to an OTS node.
|
static OSMNetwork |
findSinksandSources(OSMNetwork net,
ProgressListener progressListener) |
List<Lane> |
makeLanes(OTSRoadNetwork network,
OSMLink osmlink,
OTSSimulatorInterface simulator,
WarningListener warningListener)
This method creates lanes out of an OSM link LaneTypes are not yet extensive and can be further increased through Tags
provided by OSM.
|
static LaneType |
makeLaneType(OTSRoadNetwork network,
GTUType gtuType)
This method creates a LaneType which supports the specified GTUType.
|
static LaneType |
makeLaneType(OTSRoadNetwork network,
List<GTUType> gtuTypes)
This method creates a LaneType which supports all GTUTypes that have been specified in the GTUType List "GTUs".
|
String |
toString() |
static org.locationtech.jts.geom.Coordinate |
transform(org.locationtech.jts.geom.Coordinate c) |
public static org.locationtech.jts.geom.Coordinate transform(org.locationtech.jts.geom.Coordinate c) throws TransformException
c
- Coordinate; Coordinate in WGS84TransformException
- on problems with the coordinate transformationpublic CrossSectionLink convertLink(OTSRoadNetwork network, OSMLink link, OTSSimulatorInterface simulator) throws OTSGeometryException, NetworkException
network
- OTSRoadNetwork; the networklink
- OSMLink; OSM Link to be convertedsimulator
- OTSSimulatorInterface; the simulator that will animate the generates lanes (if it happens to be an
instance of AnimatorInterface)OTSGeometryException
- on failureNetworkException
- if link already exists in the network, if name of the link is not unique, or if the start node
or the end node of the link are not registered in the network.public OTSNode convertNode(OTSRoadNetwork network, OSMNode node) throws NetworkException
network
- OTSRoadNetwork; the networknode
- OSMNode; OSM Node to be convertedNetworkException
- if node already exists in the network, or if name of the node is not uniquepublic List<Lane> makeLanes(OTSRoadNetwork network, OSMLink osmlink, OTSSimulatorInterface simulator, WarningListener warningListener) throws NetworkException, NamingException, OTSGeometryException
network
- OTSRoadNetwork; the networkosmlink
- Link OSMLink; the OSM link to make lanes forsimulator
- OTSSimulatorInterface; the simulator that will animate the generates lanes (if it happens to be an
instance of AnimatorInterface)warningListener
- WarningListener; the warning listener that will receive warning eventsNetworkException
- on network inconsistencyNamingException
- on naming problems (in the animator)OTSGeometryException
- when lane contour or center line cannot be instantiatedpublic static LaneType makeLaneType(OTSRoadNetwork network, List<GTUType> gtuTypes)
network
- the networkgtuTypes
- List<GTUType>; list of GTUTypespublic static LaneType makeLaneType(OTSRoadNetwork network, GTUType gtuType)
network
- the networkgtuType
- GTUType; the type of GTU that can travel on the new LaneTypepublic static OSMNetwork findSinksandSources(OSMNetwork net, ProgressListener progressListener)
net
- OSMNetwork; The OSM network which is to be searched for Sinks and Sources.progressListener
- ProgressListener; the progress listener that will receive progress eventsCopyright © 2014–2019 Delft University of Technology. All rights reserved.