Package org.goplanit.matsim.converter
Class MatsimRoutedServicesWriter
- java.lang.Object
-
- org.goplanit.converter.BaseWriterImpl<T>
-
- org.goplanit.converter.CrsWriterImpl<T>
-
- org.goplanit.matsim.converter.MatsimWriter<RoutedServices>
-
- org.goplanit.matsim.converter.MatsimRoutedServicesWriter
-
- All Implemented Interfaces:
ConverterEntity,ConverterWriter<RoutedServices>,RoutedServicesWriter
public class MatsimRoutedServicesWriter extends MatsimWriter<RoutedServices> implements RoutedServicesWriter
A class that takes a PLANit routed services (and its reference service network, zoning and physical network) to extract and writes the MATSIM public transport information to disk.- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected MatsimNetworkWriterSettingsnetworkSettingsthe network settings to use required to sync our services references to zoning informationprotected ZoningreferenceZoningreference zoning to extract pt stops from (rather than service nodes)protected MatsimZoningWriterSettingszoningSettingsthe zoning settings to use required to sync our services references to zoning information-
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 protectedMatsimRoutedServicesWriter(MatsimPtServicesWriterSettings routedServicesWriterSettings, MatsimNetworkWriterSettings networkSettings, MatsimZoningWriterSettings zoningSettings, Zoning referenceZoning)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RoutedServicesIdMappergetPrimaryIdMapper()The (main) Id mapper used by this writer (only present after write has been completed)MatsimPtServicesWriterSettingsgetSettings()Collect the settingsvoidreset()reset the reader to allow for marking unnecessary resources for garbage collectionvoidwrite(RoutedServices routedServices)extract public transport information from PLANit zoning and use it to persist as much of the MATSim public transport XML as possible-
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.service.RoutedServicesWriter
getTypeDescription
-
-
-
-
Field Detail
-
networkSettings
protected final MatsimNetworkWriterSettings networkSettings
the network settings to use required to sync our services references to zoning information
-
zoningSettings
protected final MatsimZoningWriterSettings zoningSettings
the zoning settings to use required to sync our services references to zoning information
-
referenceZoning
protected final Zoning referenceZoning
reference zoning to extract pt stops from (rather than service nodes)
-
-
Constructor Detail
-
MatsimRoutedServicesWriter
protected MatsimRoutedServicesWriter(MatsimPtServicesWriterSettings routedServicesWriterSettings, MatsimNetworkWriterSettings networkSettings, MatsimZoningWriterSettings zoningSettings, Zoning referenceZoning)
Constructor.- Parameters:
routedServicesWriterSettings- actual settings related to what user has configured for thisnetworkSettings- used to make sure references are synced with network, not used to expose/change settingszoningSettings- used to make sure references are synced with zoning, not used to expose/change settingsreferenceZoning- to use
-
-
Method Detail
-
write
public void write(RoutedServices routedServices) throws PlanItException
extract public transport information from PLANit zoning and use it to persist as much of the MATSim public transport XML as possible- Specified by:
writein interfaceConverterWriter<RoutedServices>- Parameters:
routedServices- 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:
resetin interfaceConverterEntity
-
getSettings
public MatsimPtServicesWriterSettings getSettings()
Collect the settings- Specified by:
getSettingsin interfaceConverterWriter<RoutedServices>- Specified by:
getSettingsin classMatsimWriter<RoutedServices>- Returns:
- settings
-
getPrimaryIdMapper
public RoutedServicesIdMapper getPrimaryIdMapper()
The (main) Id mapper used by this writer (only present after write has been completed)- Specified by:
getPrimaryIdMapperin classBaseWriterImpl<RoutedServices>- Returns:
- mapper
-
-