Legal Default Speeds
class LegalDefaultSpeeds(roadTypesByName: Map<String, RoadTypeFilter>, speedLimitsByCountryCode: Map<String, List<RoadType>>)
Class with which to look up the default speed limits per country as specified in the given data (usually default_speed_limits.json)
Functions
Link copied to clipboard
fun getSpeedLimits(countryCode: String, tags: Map<String, String>, relationsTags: List<Map<String, String>> = emptyList(), replacerFn: (name: String, evaluate: () -> Boolean) -> Boolean = { _, ev -> ev() }): LegalDefaultSpeeds.Result?
Given a country/subdivision and a set of tags on the road (segment), will return a set of additional maxspeed tags the road can be assumed to have based on other properties of the road or (optionally) of which relations it is a member of. Returns null if nothing was found.
Link copied to clipboard
Returns whether the given tag key is relevant for getting the speed limits. This can be used to reduce the tags set on roads to only the relevant ones, which makes the queries faster and makes it easier to cache it.