Package org.goplanit.osm.defaults
Class OsmSpeedLimitDefaultsCategory
- java.lang.Object
-
- org.goplanit.osm.defaults.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 Summary
Fields Modifier and Type Field Description protected OsmSpeedLimitDefaultsCategorybackupDefaultsprotected StringcountryNamecountry these defaults apply forprotected Map<String,Map<String,Double>>speedLimitDefaultsstore OSM way defaults in this map by key,value of the tagging used
-
Constructor Summary
Constructors Modifier Constructor Description OsmSpeedLimitDefaultsCategory(String countryName)Constructor.OsmSpeedLimitDefaultsCategory(String countryName, OsmSpeedLimitDefaultsCategory backupDefaults)Constructor.protectedOsmSpeedLimitDefaultsCategory(OsmSpeedLimitDefaultsCategory other, boolean deepClone)Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsSpeedLimit(String type)verify if a default speed limit is available for the given typeOsmSpeedLimitDefaultsCategorydeepClone()deep clone this class instanceStringgetCountry()collect the country nameDoublegetSpeedLimit(String key, String type)Get a speed limit default for a given way typevoidsetSpeedLimitDefault(String key, String type, double speedLimitKmH)Set a speed default for a given typeOsmSpeedLimitDefaultsCategoryshallowClone()shallow clone this class instance
-
-
-
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
-
backupDefaults
protected final OsmSpeedLimitDefaultsCategory backupDefaults
-
countryName
protected final String countryName
country these defaults apply for
-
-
Constructor Detail
-
OsmSpeedLimitDefaultsCategory
protected OsmSpeedLimitDefaultsCategory(OsmSpeedLimitDefaultsCategory other, boolean deepClone)
Copy constructor- Parameters:
other- to usedeepClone- 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 forbackupDefaults- 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 typetype- of the way to set speed default forspeedLimitKmH- 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 typetype- 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
-
shallowClone
public OsmSpeedLimitDefaultsCategory shallowClone()
shallow clone this class instance- Returns:
- shallow copy
-
deepClone
public OsmSpeedLimitDefaultsCategory deepClone()
deep clone this class instance- Returns:
- deep copy
-
-