You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When parsing combined OSM tag values of tracktype currently only values listed with ; are taken into account but not ranges listed with -. However, according to taginfo there is an order of magnitude more occurrences of the latter ones than the former ones.
# query data from taginfourl<-"https://taginfo.openstreetmap.org/api/4/key/values?key=tracktype&filter=ways&sortname=count&sortorder=desc&qtype=value"res<-jsonlite::fromJSON(url)$data# number of combined range-type values
with(res, count[grepl("-", value) & grepl("grade", value)] |> sum())
#> [1] 3493# number of combined semicolon-separated values
with(res, count[grepl(";", value) & grepl("grade", value)] |> sum())
#> [1] 296
Include parsing of grade range values provided with -.
protectedintgetTrackGradeLevel(Stringgrade) {
if (grade == null)
return0;
switch (grade) {
// official valuescase"grade1":
return1;
case"grade2":
return2;
case"grade3":
return3;
case"grade4":
return4;
case"grade5":
return5;
// attempt to extract meaningful values from common tagging mistakescase"grade6":
case"grade7":
case"grade8":
return6;
default:
// call specialized parsing function:// split on ";" or "-"// remove "grade" and trim whitespaces// parse as integer and take maximum over these values and 6//// bonus: parse single-number values such as `tracktype=5`
}
return0;
}
The text was updated successfully, but these errors were encountered:
Problem description
When parsing combined OSM tag values of tracktype currently only values listed with
;
are taken into account but not ranges listed with-
. However, according to taginfo there is an order of magnitude more occurrences of the latter ones than the former ones.Created on 2024-04-05 with reprex v2.0.2
Other common easy to address tagging mistakes
Created on 2024-04-05 with reprex v2.0.2
Current code for parsing
tracktype
valuesopenrouteservice/ors-engine/src/main/java/org/heigit/ors/routing/graphhopper/extensions/flagencoders/VehicleFlagEncoder.java
Lines 420 to 457 in 78ec9ad
Proposed solution
Include parsing of grade range values provided with
-
.The text was updated successfully, but these errors were encountered: