Package org.goplanit.osm.defaults
Class OsmSpeedLimitDefaultsCategory
- java.lang.Object
-
- org.goplanit.osm.defaults.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 Summary
Fields Modifier and Type Field Description protected OsmSpeedLimitDefaultsCategory
backupDefaults
protected String
countryName
country these defaults apply forprotected Map<String,Double>
speedLimitDefaults
store osmway defaults in this map
-
Constructor Summary
Constructors Constructor Description OsmSpeedLimitDefaultsCategory(String countryName)
Constructor.OsmSpeedLimitDefaultsCategory(String countryName, OsmSpeedLimitDefaultsCategory backupDefaults)
Constructor.OsmSpeedLimitDefaultsCategory(OsmSpeedLimitDefaultsCategory other)
Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OsmSpeedLimitDefaultsCategory
clone()
clone this class instanceboolean
containsSpeedLimit(String type)
verify if a default speed limit is available for the given typeString
getCountry()
collect the country nameDouble
getSpeedLimit(String type)
Get a speed limit default for a given way typevoid
setSpeedLimitDefault(String type, double speedLimitKmH)
Set a speed default for a given type
-
-
-
Field Detail
-
speedLimitDefaults
protected final Map<String,Double> speedLimitDefaults
store osmway defaults in this map
-
backupDefaults
protected final OsmSpeedLimitDefaultsCategory backupDefaults
-
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 forbackupDefaults
- 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 forspeedLimitKmH
- 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
-
clone
public OsmSpeedLimitDefaultsCategory clone()
clone this class instance
-
-