Class OsmSpeedLimitDefaultsCategory

  • All Implemented Interfaces:
    Cloneable

    public class OsmSpeedLimitDefaultsCategory
    extends Object
    implements Cloneable
    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,​Double> speedLimitDefaults
        store osmway defaults in this map
      • countryName

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

      • 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
      • OsmSpeedLimitDefaultsCategory

        public OsmSpeedLimitDefaultsCategory​(OsmSpeedLimitDefaultsCategory other)
        Copy constructor
        Parameters:
        other - to use
    • Method Detail

      • setSpeedLimitDefault

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

        public Double getSpeedLimit​(String type)
        Get a speed limit default for a given way type
        Parameters:
        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