Package org.goplanit.matsim.converter
Class MatsimNetworkWriter
- java.lang.Object
-
- org.goplanit.converter.BaseWriterImpl<T>
-
- org.goplanit.converter.CrsWriterImpl<T>
-
- org.goplanit.matsim.converter.MatsimWriter<LayeredNetwork<?,?>>
-
- org.goplanit.matsim.converter.MatsimNetworkWriter
-
- All Implemented Interfaces:
ConverterEntity,ConverterWriter<LayeredNetwork<?,?>>,NetworkWriter
public class MatsimNetworkWriter extends MatsimWriter<LayeredNetwork<?,?>> 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 StringDEFAULT_NETWORK_GEOMETRY_FILE_NAMEdefault names used for MATSIM network file that is being generatedstatic StringDEFAULT_NETWORK_GEOMETRY_FILE_NAME_EXTENSIONdefault names used for MATSIM network file that is being generatedprotected MatsimNetworkWriterSettingssettingsMATSIM writer settings-
Fields inherited from class org.goplanit.matsim.converter.MatsimWriter
DEFAULT_FILE_NAME_EXTENSION, NETWORK_DOCTYPE, TRANSIT_SCHEDULE_DOCTYPE
-
Fields inherited from class org.goplanit.converter.BaseWriterImpl
idMapper
-
-
Constructor Summary
Constructors Modifier Constructor Description MatsimNetworkWriter()Default constructor.protectedMatsimNetworkWriter(MatsimNetworkWriterSettings networkSettings)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NetworkIdMappergetPrimaryIdMapper()The (main) Id mapper used by this writer (only present after write has been completed)MatsimNetworkWriterSettingsgetSettings()any settings to configure the writer can be configured by collecting these settingsvoidreset()reset the reader to allow for marking unnecessary resources for garbage collectionvoidwrite(LayeredNetwork<?,?> network)write a network to the writer's output format.protected voidwriteDetailedGeometryFile(MacroscopicNetworkLayerImpl networkLayer)Create detailed geometry file compatible with VIA viewerprotected voidwriteXmlNetworkFile(MacroscopicNetworkLayerImpl networkLayer)write the xml MATSIM network-
Methods inherited from class org.goplanit.matsim.converter.MatsimWriter
decreaseIndentation, extractDestinationCrsCompatibleCoordinate, increaseIndentation, validateNetwork, writeEndElementNewLine, writeIndentation, writeStartElement, writeStartElementNewLine
-
Methods inherited from class org.goplanit.converter.CrsWriterImpl
createTransformedCoordinate, extractSrsName, getDestinationCoordinateReferenceSystem, getDestinationCrsTransformer, getGeoUtils, getTransformedCoordinates, prepareCoordinateReferenceSystem
-
Methods inherited from class org.goplanit.converter.BaseWriterImpl
getComponentIdMappers, getIdMapperType, setIdMapperType, setParentIdMappers
-
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
-
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(LayeredNetwork<?,?> network) throws PlanItException
write a network to the writer's output format.- Specified by:
writein interfaceConverterWriter<LayeredNetwork<?,?>>- 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:
resetin interfaceConverterEntity
-
getSettings
public MatsimNetworkWriterSettings getSettings()
any settings to configure the writer can be configured by collecting these settings- Specified by:
getSettingsin interfaceConverterWriter<LayeredNetwork<?,?>>- Specified by:
getSettingsin classMatsimWriter<LayeredNetwork<?,?>>- Returns:
- the settings to configure the writer
-
getPrimaryIdMapper
public NetworkIdMapper getPrimaryIdMapper()
The (main) Id mapper used by this writer (only present after write has been completed)- Specified by:
getPrimaryIdMapperin classBaseWriterImpl<LayeredNetwork<?,?>>- Returns:
- mapper
-
-