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 protected
PlanitNetworkWriter(String networkPath, String countryName, org.goplanit.xml.generated.XMLElementMacroscopicNetwork xmlRawNetwork)
Constructorprotected
PlanitNetworkWriter(String networkPath, org.goplanit.xml.generated.XMLElementMacroscopicNetwork xmlRawNetwork)
Constructorprotected
PlanitNetworkWriter(org.goplanit.xml.generated.XMLElementMacroscopicNetwork xmlRawNetwork)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NetworkIdMapper
getPrimaryIdMapper()
The (main) Id mapper used by this writer (only present after write has been completed)PlanitNetworkWriterSettings
getSettings()
any settings to configure the writer can be configured by collecting these settingsprotected void
populateXmlConfiguration(Modes modes)
Populate the link configuration for this network, i.e., the modesprotected void
populateXmlLayerConfiguration(org.goplanit.xml.generated.XMLElementInfrastructureLayer xmlNetworkLayer, MacroscopicLinkSegmentTypes linkSegmentTypes)
Populate the layer configuration for this network, i.e., link segment typesprotected void
populateXmlNetworkLayer(org.goplanit.xml.generated.XMLElementInfrastructureLayers xmlInfrastructureLayers, MacroscopicNetworkLayerImpl physicalNetworkLayer, MacroscopicNetwork network)
Populate the network layerprotected void
populateXmlNetworkLayers(MacroscopicNetwork network)
Populate the available network layersvoid
reset()
reset the reader to allow for marking unnecessary resources for garbage collectionvoid
write(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:BaseWriterImpl
The (main) Id mapper used by this writer (only present after write has been completed)- Specified by:
getPrimaryIdMapper
in classBaseWriterImpl<LayeredNetwork<?,?>>
- Returns:
- network id mapper
-
write
public void write(LayeredNetwork<?,?> network)
write a network to the writer's output format.- Specified by:
write
in 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:
reset
in interfaceConverterEntity
-
getSettings
public PlanitNetworkWriterSettings getSettings()
any settings to configure the writer can be configured by collecting these settings- Specified by:
getSettings
in interfaceConverterWriter<LayeredNetwork<?,?>>
- Returns:
- the settings to configure the writer
-
-