Class PlanitNetworkWriter
- java.lang.Object
-
- org.goplanit.converter.BaseWriterImpl<T>
-
- org.goplanit.converter.CrsWriterImpl<T>
-
- org.goplanit.io.converter.PlanitWriterImpl<T>
-
- org.goplanit.io.converter.network.UnTypedPlanitCrsWriterImpl<LayeredNetwork<?,?>>
-
- org.goplanit.io.converter.network.PlanitNetworkWriter
-
- All Implemented Interfaces:
ConverterEntity,ConverterWriter<LayeredNetwork<?,?>>,NetworkWriter
public class PlanitNetworkWriter extends UnTypedPlanitCrsWriterImpl<LayeredNetwork<?,?>> implements NetworkWriter
Writer to persist a PLANit network to disk in the native PLANit format. By default the xml ids are used for writing out the ids in the XML.- Author:
- markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.converter.BaseWriterImpl
idMapper
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPlanitNetworkWriter(String networkPath, String countryName, org.goplanit.xml.generated.XMLElementMacroscopicNetwork xmlRawNetwork)ConstructorprotectedPlanitNetworkWriter(String networkPath, org.goplanit.xml.generated.XMLElementMacroscopicNetwork xmlRawNetwork)ConstructorprotectedPlanitNetworkWriter(org.goplanit.xml.generated.XMLElementMacroscopicNetwork xmlRawNetwork)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)PlanitNetworkWriterSettingsgetSettings()any settings to configure the writer can be configured by collecting these settingsprotected voidpopulateXmlConfiguration(Modes modes)Populate the link configuration for this network, i.e., the modesprotected voidpopulateXmlLayerConfiguration(org.goplanit.xml.generated.XMLElementInfrastructureLayer xmlNetworkLayer, MacroscopicLinkSegmentTypes linkSegmentTypes)Populate the layer configuration for this network, i.e., link segment typesprotected voidpopulateXmlNetworkLayer(org.goplanit.xml.generated.XMLElementInfrastructureLayers xmlInfrastructureLayers, MacroscopicNetworkLayerImpl physicalNetworkLayer, MacroscopicNetwork network)Populate the network layerprotected voidpopulateXmlNetworkLayers(MacroscopicNetwork network)Populate the available network layersvoidreset()reset the reader to allow for marking unnecessary resources for garbage collectionvoidwrite(LayeredNetwork<?,?> network)write a network to the writer's output format.-
Methods inherited from class org.goplanit.io.converter.network.UnTypedPlanitCrsWriterImpl
createGmlCoordType, createGmlDirectPositionType, createGmlLineStringType, createGmlPointType, createGmlPolygonType
-
Methods inherited from class org.goplanit.io.converter.PlanitWriterImpl
getSettingsAsXmlWriterSettings, getXmlModeReference, persist
-
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
-
-
-
-
Constructor Detail
-
PlanitNetworkWriter
protected PlanitNetworkWriter(org.goplanit.xml.generated.XMLElementMacroscopicNetwork xmlRawNetwork)
Constructor- Parameters:
xmlRawNetwork- to populate with PLANit network when persisting
-
PlanitNetworkWriter
protected PlanitNetworkWriter(String networkPath, org.goplanit.xml.generated.XMLElementMacroscopicNetwork xmlRawNetwork)
Constructor- Parameters:
networkPath- to persist network onxmlRawNetwork- to populate with PLANit network when persisting
-
PlanitNetworkWriter
protected PlanitNetworkWriter(String networkPath, String countryName, org.goplanit.xml.generated.XMLElementMacroscopicNetwork xmlRawNetwork)
Constructor- Parameters:
networkPath- to persist network oncountryName- to optimise projection for (if available, otherwise ignore)xmlRawNetwork- to populate with PLANit network when persisting
-
-
Method Detail
-
populateXmlConfiguration
protected void populateXmlConfiguration(Modes modes)
Populate the link configuration for this network, i.e., the modes- Parameters:
modes- to use to populate the XML elements
-
populateXmlLayerConfiguration
protected void populateXmlLayerConfiguration(org.goplanit.xml.generated.XMLElementInfrastructureLayer xmlNetworkLayer, MacroscopicLinkSegmentTypes linkSegmentTypes)Populate the layer configuration for this network, i.e., link segment types- Parameters:
xmlNetworkLayer- to add types tolinkSegmentTypes- to use to populate the XML elements
-
populateXmlNetworkLayer
protected void populateXmlNetworkLayer(org.goplanit.xml.generated.XMLElementInfrastructureLayers xmlInfrastructureLayers, MacroscopicNetworkLayerImpl physicalNetworkLayer, MacroscopicNetwork network)Populate the network layer- Parameters:
xmlInfrastructureLayers- to add xml layer tophysicalNetworkLayer- to populate fromnetwork- to extract from
-
populateXmlNetworkLayers
protected void populateXmlNetworkLayers(MacroscopicNetwork network)
Populate the available network layers- Parameters:
network- to extract layers from and populate xml
-
getPrimaryIdMapper
public NetworkIdMapper getPrimaryIdMapper()
Description copied from class:BaseWriterImplThe (main) Id mapper used by this writer (only present after write has been completed)- Specified by:
getPrimaryIdMapperin classBaseWriterImpl<LayeredNetwork<?,?>>- Returns:
- network id mapper
-
write
public void write(LayeredNetwork<?,?> network)
write a network to the writer's output format.- Specified by:
writein interfaceConverterWriter<LayeredNetwork<?,?>>- Parameters:
network- entity to write
-
reset
public void reset()
reset the reader to allow for marking unnecessary resources for garbage collection- Specified by:
resetin interfaceConverterEntity
-
getSettings
public PlanitNetworkWriterSettings getSettings()
any settings to configure the writer can be configured by collecting these settings- Specified by:
getSettingsin interfaceConverterWriter<LayeredNetwork<?,?>>- Returns:
- the settings to configure the writer
-
-