Class MatsimNetworkWriterSettings

  • All Implemented Interfaces:
    ConverterWriterSettings

    public class MatsimNetworkWriterSettings
    extends PlanitMatsimWriterModeMappingSettings
    implements ConverterWriterSettings
    Settings for the MATSIM writer By default the MATSIM writer will activate all available predefined PLANit modes for writing. In case the user wants to include custom modes as well, then they must be added manually via the class' available functionality. In case the user wants to exclude certain modes that are available in the network that is provided, they must be removed manually here as well. The CRS used for the writer is based on the CRS defined in the settings, if this is not set, we utilise the CRS corresponding to the provided country, if no country is provided, it will retain the CRS of the network provided. If the network has no CRS an exception will be thrown
    Author:
    markr
    • Field Detail

      • generateDetailedLinkGeometryFile

        protected boolean generateDetailedLinkGeometryFile
        when set to true, a separate detailed geometry file is generated that provides the detailed geometry of each link it can be used in the VIA viewer to enhance the look of the network which otherwise only depicts the end and start node, default is false
      • restrictLinkSpeedBySupportedModes

        protected boolean restrictLinkSpeedBySupportedModes
        Flag that indicates if a link's physical speed limit is to be reduced in case only modes with a lower top speed than the speed limit are included on this link. for example when a bus only network is generated, the bus max speed might be lower than the link speed limit. when set to true the speed limit is the minimum of the physical and mode speed limit. When false the physical speed limit it used.
      • DEFAULT_GENERATE_DETAILED_LINK_GEOMETRY

        public static final Boolean DEFAULT_GENERATE_DETAILED_LINK_GEOMETRY
        Default setting for generating detailed link geometry file is false
      • DEFAULT_RESTRICT_SPEED_LIMIT_BY_SUPPORTED_MODE

        public static final Boolean DEFAULT_RESTRICT_SPEED_LIMIT_BY_SUPPORTED_MODE
        Default setting for restricting a link's max speed by its supported mode max speeds if more restricting
      • DEFAULT_PUBLIC_TRANSPORT_MODE

        public static final String DEFAULT_PUBLIC_TRANSPORT_MODE
        default mode for all public transport modes in Matsim is pt, so that is what we use for initial mapping
        See Also:
        Constant Field Values
      • DEFAULT_PRIVATE_TRANSPORT_MODE

        public static final String DEFAULT_PRIVATE_TRANSPORT_MODE
        default mode for all private transport modes in Matsim is car, so that is what we use for initial mapping
        See Also:
        Constant Field Values
    • Constructor Detail

      • MatsimNetworkWriterSettings

        public MatsimNetworkWriterSettings​(String countryName)
        constructor
        Parameters:
        countryName - to use
      • MatsimNetworkWriterSettings

        public MatsimNetworkWriterSettings​(String outputDirectory,
                                           String countryName)
        constructor
        Parameters:
        outputDirectory - to use
        countryName - to use
      • MatsimNetworkWriterSettings

        public MatsimNetworkWriterSettings​(String outputDirectory,
                                           String outputFileName,
                                           String countryName)
        constructor
        Parameters:
        outputDirectory - to use
        outputFileName - to use
        countryName - to use
    • Method Detail

      • setNtCategoryFunction

        public void setNtCategoryFunction​(Function<MacroscopicLinkSegment,​String> linkNtCategoryfunction)
        Allow the user to provide their own function on how to populate the nt_category field of a MATSIM link based on the link segment that is provided to it
        Parameters:
        linkNtCategoryfunction - to apply
      • setNtTypeFunction

        public void setNtTypeFunction​(Function<MacroscopicLinkSegment,​String> linkNtTypefunction)
        Allow the user to provide their own function on how to populate the nt_type field of a MATSIM link based on the link segment that is provided to it
        Parameters:
        linkNtTypefunction - to apply
      • setTypeFunction

        public void setTypeFunction​(Function<MacroscopicLinkSegment,​String> linkTypeFunction)
        Allow the user to provide their own function on how to populate the type field of a MATSIM link based on the link segment that is provided to it
        Parameters:
        linkTypeFunction - to apply
      • isGenerateDetailedLinkGeometryFile

        public boolean isGenerateDetailedLinkGeometryFile()
        Check if a detailed geometry file is generated
        Returns:
        true when active, false otherwise
      • setGenerateDetailedLinkGeometryFile

        public void setGenerateDetailedLinkGeometryFile​(boolean generateDetailedLinkGeometryFile)
        Set the choice for whether a detailed geometry file for each link is created. This geometry is extracted from the PLANit link geometry.
        Parameters:
        generateDetailedLinkGeometryFile - flag indicating to generate geometry file or not
      • isRestrictLinkSpeedBySupportedModes

        public boolean isRestrictLinkSpeedBySupportedModes()
        Check if link speed is to be restricted by the supported modes' max speed (if more restrictive)
        Returns:
        true when active, false otherwise
      • setRestrictLinkSpeedBySupportedModes

        public void setRestrictLinkSpeedBySupportedModes​(boolean restrictLinkSpeedBySupportedModes)
        Set if link speed is to be restricted by the supported modes' max speed (if more restrictive)
        Parameters:
        restrictLinkSpeedBySupportedModes - flag to set