Package org.goplanit.matsim.converter
Class MatsimZoningWriter
- java.lang.Object
-
- org.goplanit.converter.BaseWriterImpl<T>
-
- org.goplanit.matsim.converter.MatsimWriter<Zoning>
-
- org.goplanit.matsim.converter.MatsimZoningWriter
-
- All Implemented Interfaces:
ConverterEntity
,ConverterWriter<Zoning>
,ZoningWriter
public class MatsimZoningWriter extends MatsimWriter<Zoning> implements ZoningWriter
A class that takes a PLANit zoning and extracts and writes the MATSIM public transport information to disk.- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description static String
DOCTYPE
the doc type of MATSIM public transport schedule.-
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 protected
MatsimZoningWriter(MatsimZoningWriterSettings zoningWriterSettings, MatsimNetworkWriterSettings networkWriterSettings)
constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MatsimZoningWriterSettings
getSettings()
Collect the zoning writer settingsvoid
reset()
reset the reader to allow for marking unnecessary resources for garbage collectionvoid
write(Zoning zoning)
extract public transport information from planit zoning and use it to persist as much of the matsim public transport xml's as possibleprotected void
writeTransitScheduleXML(XMLStreamWriter xmlWriter, Zoning zoning, MacroscopicNetworkLayer networkLayer)
convert the planit public transport infrastructure to matsim transit schedule xmlprotected void
writeXmlTransitScheduleFile(Zoning zoning)
Starting point for persisting the matsim transit schedule file-
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.zoning.ZoningWriter
getTypeDescription
-
-
-
-
Field Detail
-
DOCTYPE
public static final String DOCTYPE
the doc type of MATSIM public transport schedule. For now we persist in v1 (v2 does exist but is not documented (yet) in Matsim manual)- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MatsimZoningWriter
protected MatsimZoningWriter(MatsimZoningWriterSettings zoningWriterSettings, MatsimNetworkWriterSettings networkWriterSettings)
constructor- Parameters:
zoningWriterSettings
- to usenetworkWriterSettings
- the network was configured by when persisting
-
-
Method Detail
-
writeXmlTransitScheduleFile
protected void writeXmlTransitScheduleFile(Zoning zoning) throws PlanItException
Starting point for persisting the matsim transit schedule file- Parameters:
zoning
- to persist- Throws:
PlanItException
- thrown if error
-
writeTransitScheduleXML
protected void writeTransitScheduleXML(XMLStreamWriter xmlWriter, Zoning zoning, MacroscopicNetworkLayer networkLayer) throws PlanItException
convert the planit public transport infrastructure to matsim transit schedule xml- Parameters:
xmlWriter
- to usezoning
- to usenetworkLayer
- to use- Throws:
PlanItException
- thrown if error
-
write
public void write(Zoning zoning) throws PlanItException
extract public transport information from planit zoning and use it to persist as much of the matsim public transport xml's as possible- Specified by:
write
in interfaceConverterWriter<Zoning>
- Parameters:
zoning
- to use for matsim pt persistence- 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 MatsimZoningWriterSettings getSettings()
Collect the zoning writer settings- Specified by:
getSettings
in interfaceConverterWriter<Zoning>
- Returns:
- zoning writer settings
-
-