Class Convert
- java.lang.Object
-
- org.opentrafficsim.road.network.factory.osm.output.Convert
-
public final class Convert extends java.lang.ObjectCopyright (c) 2013-2020 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
- Author:
- Peter Knoppers, Moritz Bergmann
-
-
Constructor Summary
Constructors Constructor Description Convert()Construct a converter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CrossSectionLinkconvertLink(OTSRoadNetwork network, OSMLink link, OTSSimulatorInterface simulator)This method converts an OSM link to an OTS link.OTSRoadNodeconvertNode(OTSRoadNetwork network, OSMNode node)This method converts an OSM node to an OTS node.static OSMNetworkfindSinksandSources(OSMNetwork net, ProgressListener progressListener)java.util.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 LaneTypemakeLaneType(OTSRoadNetwork network, java.util.List<GTUType> gtuTypes)This method creates a LaneType which supports all GTUTypes that have been specified in the GTUType List "GTUs".static LaneTypemakeLaneType(OTSRoadNetwork network, GTUType gtuType)This method creates a LaneType which supports the specified GTUType.java.lang.StringtoString()static org.locationtech.jts.geom.Coordinatetransform(org.locationtech.jts.geom.Coordinate c)
-
-
-
Method Detail
-
transform
public static org.locationtech.jts.geom.Coordinate transform(org.locationtech.jts.geom.Coordinate c) throws javax.xml.crypto.dsig.TransformException- Parameters:
c- Coordinate; Coordinate in WGS84- Returns:
- Coordinate in Geocentric Cartesian system
- Throws:
javax.xml.crypto.dsig.TransformException- on problems with the coordinate transformation
-
convertLink
public CrossSectionLink convertLink(OTSRoadNetwork network, OSMLink link, OTSSimulatorInterface simulator) throws OTSGeometryException, NetworkException
This method converts an OSM link to an OTS link.- Parameters:
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)- Returns:
- OTS Link
- Throws:
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.
-
convertNode
public OTSRoadNode convertNode(OTSRoadNetwork network, OSMNode node) throws NetworkException
This method converts an OSM node to an OTS node.- Parameters:
network- OTSRoadNetwork; the networknode- OSMNode; OSM Node to be converted- Returns:
- OTSRoadNode
- Throws:
NetworkException- if node already exists in the network, or if name of the node is not unique
-
makeLanes
public java.util.List<Lane> makeLanes(OTSRoadNetwork network, OSMLink osmlink, OTSSimulatorInterface simulator, WarningListener warningListener) throws NetworkException, javax.naming.NamingException, OTSGeometryException
This method creates lanes out of an OSM link LaneTypes are not yet extensive and can be further increased through Tags provided by OSM. The standard lane width of 3.05 is an estimation based on the European width limitation for vehicles (2.55m) + 25cm each side.- Parameters:
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 events- Returns:
- List<Lane>
- Throws:
NetworkException- on network inconsistencyjavax.naming.NamingException- on naming problems (in the animator)OTSGeometryException- when lane contour or center line cannot be instantiated
-
makeLaneType
public static LaneType makeLaneType(OTSRoadNetwork network, java.util.List<GTUType> gtuTypes)
This method creates a LaneType which supports all GTUTypes that have been specified in the GTUType List "GTUs".- Parameters:
network- the networkgtuTypes- List<GTUType>; list of GTUTypes- Returns:
- LaneType permeable for all of the specific GTUTypes
-
makeLaneType
public static LaneType makeLaneType(OTSRoadNetwork network, GTUType gtuType)
This method creates a LaneType which supports the specified GTUType.- Parameters:
network- the networkgtuType- GTUType; the type of GTU that can travel on the new LaneType- Returns:
- LaneType
-
findSinksandSources
public static OSMNetwork findSinksandSources(OSMNetwork net, ProgressListener progressListener)
- Parameters:
net- OSMNetwork; The OSM network which is to be searched for Sinks and Sources.progressListener- ProgressListener; the progress listener that will receive progress events- Returns:
- Network with all possible sinks and sources tagged.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-