Class OsmModeAccessDefaultsByCountry


  • public class OsmModeAccessDefaultsByCountry
    extends Object
    The defaults for the mode access in case no specific restrictions are indicated on the highway=type way. Based on the information provided on https://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Access_restrictions

    Note: not all highway types have defaults following the references wiki page. Those missing types are listed below with the assigned defaults based on PLANit's own rules:

    • highway:service, same as road
    • track, same as road
    Author:
    markr
    • Field Detail

      • globalModeAccessDefaults

        protected static OsmModeAccessDefaults globalModeAccessDefaults
        store the global defaults as fall back option
      • modeAccessDefaultsByCountry

        protected static Map<String,​OsmModeAccessDefaults> modeAccessDefaultsByCountry
        store all defaults per country by ISO2 code
    • Constructor Detail

      • OsmModeAccessDefaultsByCountry

        public OsmModeAccessDefaultsByCountry()
    • Method Detail

      • populateGlobalDefaultHighwayModeAccess

        protected static void populateGlobalDefaultHighwayModeAccess()
        populate the global defaults for highway types, i.e., roads
      • populateGlobalDefaultRailwayModeAccess

        protected static void populateGlobalDefaultRailwayModeAccess()
        populate the global defaults for railway types
      • populateGlobalDefaultWaterwayModeAccess

        protected static void populateGlobalDefaultWaterwayModeAccess()
        populate the global defaults for waterway types.
      • populateCountrySpecificDefaultModeAccess

        protected static void populateCountrySpecificDefaultModeAccess()
        For all countries for which a dedicated CSV is available under the resources dir, we parse their mode access defaults accordingly
      • populateCountrySpecificDefaultModeAccess

        protected static void populateCountrySpecificDefaultModeAccess​(InputStreamReader inputReader,
                                                                       String fullCountryName)
        Each file should be named according to ISO366 alpha 2 country code. The mode access defaults are parsed as CSV format and overwrite the global defaults for this country. If no explicit value is provided, we revert to the global defaults instead.
        Parameters:
        inputReader - to extract speed limit defaults from
        fullCountryName - these defaults relate to
      • setDefaultsByCountry

        protected static void setDefaultsByCountry​(OsmModeAccessDefaults modeAccessDefaults)
        Set defaults for a specific county
        Parameters:
        modeAccessDefaults - defaults to use
      • create

        public static OsmModeAccessDefaults create()
        Default factory method for creating global defaults
        Returns:
        created mode access defaults
      • create

        public static OsmModeAccessDefaults create​(String countryName)
        Factory method to create defaults based on a given country. If country cannot be found or cannot be converted into ISO2 country code, we revert to global defaults
        Parameters:
        countryName - to base on
        Returns:
        created mode access defaults