Package org.goplanit.matsim.converter
Class MatsimNetworkWriter
- java.lang.Object
-
- org.goplanit.converter.BaseWriterImpl<T>
-
- org.goplanit.matsim.converter.MatsimWriter<TransportLayerNetwork<?,?>>
-
- org.goplanit.matsim.converter.MatsimNetworkWriter
-
- All Implemented Interfaces:
ConverterEntity
,ConverterWriter<TransportLayerNetwork<?,?>>
,NetworkWriter
public class MatsimNetworkWriter extends MatsimWriter<TransportLayerNetwork<?,?>> implements NetworkWriter
A class that takes a PLANit network and writes it as a MATSIM network.- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_NETWORK_GEOMETRY_FILE_NAME
default names used for MATSIM network file that is being generatedstatic String
DEFAULT_NETWORK_GEOMETRY_FILE_NAME_EXTENSION
default names used for MATSIM network file that is being generatedstatic String
DOCTYPE
the doc type of MATSIM networkprotected MatsimNetworkWriterSettings
settings
MATSIM writer settings-
Fields inherited from class org.goplanit.matsim.converter.MatsimWriter
DEFAULT_FILE_NAME_EXTENSION, destinationCrsTransformer, indentLevel
-
Fields inherited from class org.goplanit.converter.BaseWriterImpl
idMapper
-
-
Constructor Summary
Constructors Modifier Constructor Description MatsimNetworkWriter()
Default constructor.protected
MatsimNetworkWriter(MatsimNetworkWriterSettings networkSettings)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MatsimNetworkWriterSettings
getSettings()
any settings to configure the writer can be configured by collecting these settingsvoid
reset()
reset the reader to allow for marking unnecessary resources for garbage collectionvoid
write(TransportLayerNetwork<?,?> network)
write a network to the writer's output format.protected void
writeDetailedGeometryFile(MacroscopicNetworkLayerImpl networkLayer)
Create detailed geometry file compatible with VIA viewerprotected void
writeXmlNetworkFile(MacroscopicNetworkLayerImpl networkLayer)
write the xml MATSIM network-
Methods inherited from class org.goplanit.matsim.converter.MatsimWriter
decreaseIndentation, extractDestinationCrsCompatibleCoordinate, increaseIndentation, prepareCoordinateReferenceSystem, validateNetwork, writeEndElementNewLine, writeIndentation, writeStartElementNewLine
-
Methods inherited from class org.goplanit.converter.BaseWriterImpl
getIdMapperType, identifyDestinationCoordinateReferenceSystem, setIdMapperType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.converter.ConverterWriter
getIdMapperType, setIdMapperType
-
Methods inherited from interface org.goplanit.converter.network.NetworkWriter
getTypeDescription
-
-
-
-
Field Detail
-
settings
protected final MatsimNetworkWriterSettings settings
MATSIM writer settings
-
DOCTYPE
public static final String DOCTYPE
the doc type of MATSIM network- See Also:
- Constant Field Values
-
DEFAULT_NETWORK_GEOMETRY_FILE_NAME_EXTENSION
public static final String DEFAULT_NETWORK_GEOMETRY_FILE_NAME_EXTENSION
default names used for MATSIM network file that is being generated- See Also:
- Constant Field Values
-
DEFAULT_NETWORK_GEOMETRY_FILE_NAME
public static final String DEFAULT_NETWORK_GEOMETRY_FILE_NAME
default names used for MATSIM network file that is being generated- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MatsimNetworkWriter
public MatsimNetworkWriter()
Default constructor. Initialisng with default output directory and country name on the settings
-
MatsimNetworkWriter
protected MatsimNetworkWriter(MatsimNetworkWriterSettings networkSettings)
Constructor- Parameters:
networkSettings
- network settings to use
-
-
Method Detail
-
writeXmlNetworkFile
protected void writeXmlNetworkFile(MacroscopicNetworkLayerImpl networkLayer) throws PlanItException
write the xml MATSIM network- Parameters:
networkLayer
- to draw from- Throws:
PlanItException
- thrown if error
-
writeDetailedGeometryFile
protected void writeDetailedGeometryFile(MacroscopicNetworkLayerImpl networkLayer) throws PlanItException
Create detailed geometry file compatible with VIA viewer- Parameters:
networkLayer
- to draw from- Throws:
PlanItException
- thrown if error
-
write
public void write(TransportLayerNetwork<?,?> network) throws PlanItException
write a network to the writer's output format.- Specified by:
write
in interfaceConverterWriter<TransportLayerNetwork<?,?>>
- Parameters:
network
- entity to write- Throws:
PlanItException
- thrown if error
-
reset
public void reset()
reset the reader to allow for marking unnecessary resources for garbage collection- Specified by:
reset
in interfaceConverterEntity
-
getSettings
public MatsimNetworkWriterSettings getSettings()
any settings to configure the writer can be configured by collecting these settings- Specified by:
getSettings
in interfaceConverterWriter<TransportLayerNetwork<?,?>>
- Returns:
- the settings to configure the writer
-
-