Class PlanitNetworkWriter

    • Field Detail

      • DEFAULT_NETWORK_FILE_NAME

        public static final String DEFAULT_NETWORK_FILE_NAME
        default network file name to use
        See Also:
        Constant Field Values
    • 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 on
        xmlRawNetwork - 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 on
        countryName - 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 to
        linkSegmentTypes - to use to populate the XML elements
      • populateXmlNetworkLayer

        protected void populateXmlNetworkLayer​(org.goplanit.xml.generated.XMLElementInfrastructureLayers xmlInfrastructureLayers,
                                               MacroscopicNetworkLayerImpl physicalNetworkLayer)
                                        throws PlanItException
        Populate the network layer
        Parameters:
        xmlInfrastructureLayers - to add xml layer to
        physicalNetworkLayer - to populate from
        Throws:
        PlanItException - thrown if error
      • populateXmlNetworkLayers

        protected void populateXmlNetworkLayers​(MacroscopicNetwork network)
                                         throws PlanItException
        Populate the available network layers
        Parameters:
        network - to extract layers from and populate xml
        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 interface ConverterEntity
      • getCountryName

        public String getCountryName()
        the country name of the network to write (if any is set)
        Returns:
        countryname, null if unknown