Skip to content

New public transport analysis #1254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 2, 2021
Merged

New public transport analysis #1254

merged 8 commits into from
May 2, 2021

Conversation

nlehuby
Copy link
Contributor

@nlehuby nlehuby commented Apr 25, 2021

new public transport analysis that checks

  • the order of the stops
  • the side of the street

It mostly works, but with some rough angles ... help welcomed to fine tune ;)

First, it computes the shape of each route as a linestring when possible :
it takes the ways in the relation in their order and try to make a linestring with it.
The only magic is with the un-cut roundabout : as they are closed way and don't fit in the linestring, it skips them (which is not great, see below).

For the order of the stops analysis:
Each platform is projected on the route geom (to create a kind of OSM stop_position). Then we have an error if the order of the platform in the route relation is not the same as the order of the computed stop_position on the route linestring.

Mostly tested on buses.

For the side of street analysis (only for street served transport):
It makes a buffer on the right side of the linestring geom (because as we drive on the right, the bus stop are always on the right side of the road)

image

(the buffer is actually bigger than on the picture, to stay coherent with the analysis "The stop or platform is too far from the track of this route")

Then we have an error if the platform is not inside the buffer.

this one is ok:
image

this one is an issue:
image

I've spotted two types of false positives:
The edges of the route relation: this seems quite frequent to have the start of the linestring not fully aligned with the stop.
image

I've chosen to ignore the first and last stop from the analysis because I don't know how to handle this in a better way. Ideas welcomed ;)

The stops on un-cut roundabout: as I simplify the roundabout when they are closed way, if there is a stop on the roundabout, it is very likely to not fit in the computed buffer:
image

example of false positive:
image

I guess the solution here would be to cut the roundabout when making the route linestring, but I didn't manage to dot it. Help welcomed ;)
EDIT: I finally managed to cut the roundabout 🎉 no more false positives here!

It needs to be reversed in countries that drives on the other side (take a left buffer if the bus stops are on the left side of the street). I guess we already have this kind of info as country config in Osmose, but I didn't find out how to do it : help needed here too !
EDIT: done ✔️

nlehuby added 4 commits April 25, 2021 17:22
- the order of the stops
- the side of the street
when the bus passes several times on the same street, the order of the projection on these segments are random.

offset the linestring before the projection to split the multiple passages in opposite direction
There are a lot of false positives on the first and last stops. Let's remove them from the analysis.
only make sens for street served transport
@frodrigo
Copy link
Contributor

I guess the solution here would be to cut the roundabout when making the route linestring, but I didn't manage to dot it. Help welcomed ;)

Maybe just include completely the roundabout, so it avoid false positive.

It needs to be reversed in countries that drives on the other side (take a left buffer if the bus stops are on the left side of the street). I guess we already have this kind of info as country config in Osmose, but I didn't find out how to do it : help needed here too !

Access drive side like this https://github.com/osm-fr/osmose-backend/blob/c6c0e8a4598495c3b21c308081dbda92be0d1717/analysers/analyser_osmosis_roundabout_reverse.py#L64

@nlehuby
Copy link
Contributor Author

nlehuby commented Apr 25, 2021

Thanks for the drive side, I will investigate that 👍

I guess the solution here would be to cut the roundabout when making the route linestring, but I didn't manage to dot it. Help welcomed ;)

Maybe just include completely the roundabout, so it avoid false positive.

It won't be a linestring anymore if we add a closed way in the middle of it

@frodrigo
Copy link
Contributor

Could you use uppercase for all SQL key word, please ?

@nlehuby nlehuby force-pushed the route_geom branch 3 times, most recently from 975555f to 9913d9d Compare May 1, 2021 19:24
@nlehuby
Copy link
Contributor Author

nlehuby commented May 1, 2021

I think it's ready 🚀

@frodrigo frodrigo merged commit 80ad353 into master May 2, 2021
@frodrigo
Copy link
Contributor

frodrigo commented May 2, 2021

Look good. Thank you. Not deployed yet.

@frodrigo
Copy link
Contributor

frodrigo commented May 6, 2021

Deployed yesterday. But cause lot of trouble. Take too many time on may countries.. up to timeout.

Lot of exceptions: https://buildbot.osmose.openstreetmap.fr/#/failing_builds

https://buildbot.osmose.openstreetmap.fr/#/builders/195/builds/262/steps/1/logs/stdio

@frodrigo
Copy link
Contributor

frodrigo commented May 8, 2021

Fixed with this change 5e48988

@osm-ToniE
Copy link

I think, we have a false-positive here:

https://ptna.openstreetmap.de/relation.php?id=9832010

Here, “stop_position” of stop 11 must be ignored for the bus being on the way to stops 9 and 10, but must be considered afterwards.

Ignore stop_position where the platform is on the "wrong" side, even if it is a stop_position of this route?

@osm-ToniE
Copy link

same here:

https://ptna.openstreetmap.de/relation.php?id=9832269

and this has been reported

@nlehuby
Copy link
Contributor Author

nlehuby commented May 10, 2021

see #1262 : the analysis about the stop order may return mainly false positives for now as the sql request has been changed.

@jocelynj jocelynj deleted the route_geom branch June 19, 2022 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants