luukvdmeer / sfnetworks

Tidy Geospatial Networks in R
https://luukvdmeer.github.io/sfnetworks/
Other
347 stars 20 forks source link

Function for map matching of trajectories #114

Open luukvdmeer opened 3 years ago

luukvdmeer commented 3 years ago

Is your feature request related to a problem? Please describe. Map matching of GPS trajectories is a common task in spatial network analysis. Maybe sfnetworks should have functions to support this. It is not an easy topic, but maybe there are already implementations in R that can take away some of the burden (maybe in the trajectories package?). Something to look into.

agila5 commented 3 years ago

I've never worked with trajectory data but other approaches that could be explored are trackeR and sftrack.

CKerouanton commented 3 years ago

Hello,

Here is an implementation of a famous mapmatching algorithm, in java, but can be launched from R : https://github.com/julienperret/mapmatcher

harryprince commented 2 years ago

I think we need to make a PR to add map matching functions into this repo. there is an existing simple implementation by @edzer https://github.com/ngort01/fuzzyMM

edzer commented 2 years ago

there is an existing simple implementation by @edzer https://github.com/ngort01/fuzzyMM

not by me, but by Nikolai Gorte (at that time a student I supervised)

Robinlovelace commented 2 years ago

Another approach would be an interface to existing map matching implementations, e.g. that in OSRM. Blog post on that with a detailed worked example: https://blog.dend.ro/map-matching-osrm/

grobins commented 1 year ago

Another approach would be an interface to existing map-matching implementations, e.g. that in OSRM. Blog post on that with a detailed worked example: https://blog.dend.ro/map-matching-osrm/

I have implemented OSRM to obtain OSM ids for GPS traces. I turned to sfnetworks because matching a GPS trace with the start and end locations is much faster.

The drawback I'm facing is that I want to feed in waypoints along the GPS trip, as well as the start and end constraints. I can then be more confident that the route returned matches the vehicle's actual route.

EDIT: adding the image below for clarity. The grey line is the one returned by sfnetworks, but the black line is the route I know the vehicle took. I want to use sfnetworks to force the routing to the black line, and extract all the osm_ids underneath

image