Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

tracktypes for bicycle #4930

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 2 comments
Closed

tracktypes for bicycle #4930

openstreetmap-trac opened this issue Jul 23, 2021 · 2 comments

Comments

@openstreetmap-trac
Copy link

Reporter: travelling_salesman
[Submitted to the original trac issue database at 9.37am, Saturday, 3rd August 2013]

I prepared the following patch to consider the tracktype tag for bicycles as well as for pedestrians. Previously it was only considered for motorcars.

file: gosmore/jni/libgosm.cpp
1506,1509c1506,1514
< if (k2v["tracktype"] && isdigit (k2v["tracktype"][5])) {
< s.aveSpeed[motorcarR] *= ('6' - k2v["tracktype"][5]) / 5.0;
< // Alternatively use ... (6 - atoi (k2v["tracktype"] + 5)) / 5.0;
< // TODO: Mooaar

if ((k2v["tracktype"] && isdigit (k2v["tracktype"][5])) ||
strcmp (k2v["highway"], "track") == 0) {
// many tracks don't have a tracktype, assume them as rather slow
int tracktype = 2;
if (k2v["tracktype"] && isdigit (k2v["tracktype"][5]))
tracktype = atoi (k2v["tracktype"] + 5);
s.aveSpeed[motorcarR] *= (6 - tracktype) / 5.0;
if (tracktype >= 3) s.aveSpeed[bicycleR] *= (6 - tracktype) / 4.0;
if (tracktype == 5) s.aveSpeed[footR] *= 0.8;

@openstreetmap-trac
Copy link
Author

Author: travelling_salesman
[Added to the original trac issue at 5.04pm, Sunday, 4th August 2013]

file: gosmore/jni/libgosm.cpp

1506,1509c1506,1514
<   if (k2v["tracktype"] && isdigit (k2v["tracktype"][5])) {
<     s.aveSpeed[motorcarR] *= ('6' - k2v["tracktype"][5]) / 5.0;
<     // Alternatively use ... (6 - atoi (k2v["tracktype"] + 5)) / 5.0;
<     // TODO: Mooaar
---
>   if ((k2v["tracktype"] && isdigit (k2v["tracktype"][5])) ||
>     strcmp (k2v["highway"], "track") == 0) {
>     // many tracks don't have a tracktype, assume them as rather slow
>     int tracktype = 4;
>     if (k2v["tracktype"] && isdigit (k2v["tracktype"][5]))
>       tracktype = atoi (k2v["tracktype"] + 5);
>     s.aveSpeed[motorcarR] *= (6 - tracktype) / 5.0;
>     if (tracktype >= 3) s.aveSpeed[bicycleR] *= (6 - tracktype) / 4.0;
>     if (tracktype == 5) s.aveSpeed[footR] *= 0.8;

@openstreetmap-trac
Copy link
Author

Author: mmd
[Added to the original trac issue at 6.55pm, Tuesday, 19th May 2020]

Gosmore project is no longer active, closing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant