Class OsmModeHelper

    • Constructor Detail

    • Method Detail

      • getSettings

        protected OsmNetworkReaderSettings getSettings()
        Collect the settings containing the mapping between PLANit and OSM modes
        Returns:
        settings used
      • isModeCompatible

        public boolean isModeCompatible​(Collection<String> osmModesToCheck,
                                        Collection<String> referenceOsmModes,
                                        boolean allowPseudoMatches)
        find out if link osmModesToCheck are compatible with the passed in reference osm modes. Mode compatible means at least one overlapping mode that is mapped to a planit mode. When one allows for pseudo comaptibility we relax the restrictions such that any rail/road/water mode is considered a match with any other rail/road/water mode. This can be useful when you do not want to make super strict matches but still want to filter out definite non-matches.
        Parameters:
        osmModesToCheck - to check
        referenceOsmModes - to map against (may be null)
        allowPseudoMatches - when true, we consider all road modes compatible, i.e., bus is compatible with car, train is compatible with tram, etc., when false only exact matches are accepted
        Returns:
        matched transfer zones
      • isLinkModeCompatible

        public boolean isLinkModeCompatible​(Link link,
                                            Collection<String> referenceOsmModes,
                                            boolean allowPseudoMatches)
        Find out if PLANit link is mode compatible with the passed in reference OSM modes. Mode compatible means at least one overlapping mode that is mapped to a PLANit mode. If the zone has no known modes, it is by definition not mode compatible. When one allows for pseudo compatibility we relax the restrictions such that any rail/road/water mode is considered a match with any other rail/road/water mode. This can be useful when you do not want to make super strict matches but still want to filter out definite non-matches.
        Parameters:
        link - to verify
        referenceOsmModes - to map against (may be null)
        allowPseudoMatches - when true, we consider all road modes compatible, i.e., bus is compatible with car, train is compatible with tram, etc., when false only exact matches are accepted
        Returns:
        matched transfer zones
      • filterModeCompatibleLinks

        public Collection<Link> filterModeCompatibleLinks​(Collection<String> referenceOsmModes,
                                                          Collection<Link> potentialLinks,
                                                          boolean allowPseudoModeMatches)
        Find all links with at least one compatible mode (and PLANit mode mapped) based on the passed in reference OSM modes and potential links In case no eligible modes are provided (null), we allow any transfer zone with at least one valid mapped mode
        Parameters:
        referenceOsmModes - to map against (may be null)
        potentialLinks - to extract mode compatible links from
        allowPseudoModeMatches - , when true only broad category needs to match, i.e., both have a road/rail/water mode, when false only exact matches are allowed
        Returns:
        matched links that are deemed compatible