Class OsmNetworkReader

    • Constructor Detail

      • OsmNetworkReader

        protected OsmNetworkReader​(PlanitOsmNetwork osmNetwork)
        Constructor
        Parameters:
        osmNetwork - network to populate
      • OsmNetworkReader

        protected OsmNetworkReader​(String countryName,
                                   PlanitOsmNetwork osmNetwork)
        Constructor
        Parameters:
        countryName - to use
        osmNetwork - network to populate
      • OsmNetworkReader

        protected OsmNetworkReader​(URL inputSource,
                                   String countryName,
                                   PlanitOsmNetwork osmNetworkToPopulate)
        Constructor
        Parameters:
        inputSource - to use
        countryName - to use
        osmNetworkToPopulate - network to populate
      • OsmNetworkReader

        protected OsmNetworkReader​(OsmNetworkReaderSettings settings,
                                   PlanitOsmNetwork osmNetworkToPopulate)
        Constructor
        Parameters:
        settings - for populating the network
        osmNetworkToPopulate - network to populate
    • Method Detail

      • initialiseBeforeParsing

        public void initialiseBeforeParsing()
        Call this BEFORE we parse the OSM network to initialise the handler(s) properly
      • getNetworkReaderData

        protected OsmNetworkReaderData getNetworkReaderData()
        Collect the network data gathered
        Returns:
        network data
      • removeDanglingSubNetworks

        protected void removeDanglingSubNetworks()
        Remove dangling subnetworks when settings dictate it
      • removeDanglingSubNetworks

        public void removeDanglingSubNetworks​(Zoning zoning)
        remove dangling subnetworks when settings dictate it. In case the removal of subnetworks causes zones to become dangling the user is required to remove those afterwards themselves, by providing the zoning, only the directly impacted connectoids are removed if affected.
        Parameters:
        zoning - to also remove connectoids from when they reference removed road/rail subnetworks
      • getOsmNetworkToPopulate

        protected PlanitOsmNetwork getOsmNetworkToPopulate()
        Collect the osm network to populate
        Returns:
        osm network
      • read

        public MacroscopicNetwork read()
        Parse a local *.osm or *.osm.pbf file and convert it into a Macroscopic network given the configuration options that have been set
        Specified by:
        read in interface ConverterReader<LayeredNetwork<?,​?>>
        Returns:
        macroscopic network that has been parsed
      • reset

        public void reset()
        reset the reader to allow for marking unnecessary resources for garbage collection
        Specified by:
        reset in interface ConverterEntity
      • createNetworkToZoningReaderData

        public OsmNetworkToZoningReaderData createNetworkToZoningReaderData()
        Factory method to create bridging data required for an OSM zoning reader to successfully parse the Pt zones based on the osm network parsed by this network reader. Without this data it is not possible to relate the two properly
        Returns:
        created network to zoning reader data to use