Class OsmSpeedLimitDefaultsCategory


  • public class OsmSpeedLimitDefaultsCategory
    extends Object
    Container class for storing speed limits for different waytypes for OSM. It is agnostic to if these are highway or railway types, urban or non-urban, that needs to be handled by the user of this class
    Author:
    markr
    • Field Detail

      • speedLimitDefaults

        protected final Map<String,​Map<String,​Double>> speedLimitDefaults
        store OSM way defaults in this map by key,value of the tagging used
      • countryName

        protected final String countryName
        country these defaults apply for
    • Constructor Detail

      • OsmSpeedLimitDefaultsCategory

        protected OsmSpeedLimitDefaultsCategory​(OsmSpeedLimitDefaultsCategory other,
                                                boolean deepClone)
        Copy constructor
        Parameters:
        other - to use
        deepClone - when true deep clone, otherwise shallow close
      • OsmSpeedLimitDefaultsCategory

        public OsmSpeedLimitDefaultsCategory​(String countryName)
        Constructor.
        Parameters:
        countryName - these apply for
      • OsmSpeedLimitDefaultsCategory

        public OsmSpeedLimitDefaultsCategory​(String countryName,
                                             OsmSpeedLimitDefaultsCategory backupDefaults)
        Constructor. It is advised to provide the global defaults depending on whether this is used for rail or highway
        Parameters:
        countryName - these apply for
        backupDefaults - to use when no speed limit is defined for a given way type on this instance
    • Method Detail

      • setSpeedLimitDefault

        public void setSpeedLimitDefault​(String key,
                                         String type,
                                         double speedLimitKmH)
        Set a speed default for a given type
        Parameters:
        key - key for type
        type - of the way to set speed default for
        speedLimitKmH - the physical speed limit (km/h)
      • getSpeedLimit

        public Double getSpeedLimit​(String key,
                                    String type)
        Get a speed limit default for a given way type
        Parameters:
        key - key for type
        type - of way to get speed default for
        Returns:
        the physical speed limit (km/h)
      • containsSpeedLimit

        public boolean containsSpeedLimit​(String type)
        verify if a default speed limit is available for the given type
        Parameters:
        type - to verify
        Returns:
        true when available false otherwise
      • getCountry

        public String getCountry()
        collect the country name
        Returns:
        country name