Skip to content
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

OSRM matcher results do not contain expected attributes #181

Open
joshuacroff opened this issue May 17, 2024 · 3 comments
Open

OSRM matcher results do not contain expected attributes #181

joshuacroff opened this issue May 17, 2024 · 3 comments

Comments

@joshuacroff
Copy link

Hello,

I've been using the OsrmMatcher in the mappymatch library and I've noticed that the MatchResult objects returned by the match_trace method do not contain geometry or distance to road information for the matched segments.

Here's a simplified version of the code I'm using:

import pandas as pd
import geopandas as gpd
from mappymatch.constructs.trace import Trace
from mappymatch.matchers.osrm import OsrmMatcher

# read gps points from file
gdf = gpd.read_file(file_path)

# create trace object from geodataframe
trace = Trace.from_geo_dataframe(gdf, xy=False)

# create OSRM matcher
matcher = OsrmMatcher()

# match trace
match_result = matcher.match_trace(trace)

When I inspect the MatchResult object, I see that each match has a road_id attribute, but there's no geometry or distance information available (see screenshot).
Screenshot 2024-05-17 at 11 11 13 AM

It seems like perhaps the OSRM server does not return geometry information as part of the map matching process, but it would be very helpful if the MatchResult objects could include this information. This would allow users to visualize the matched segments without having to manually retrieve the geometry from their original map data.

Is there a way to include geometry information in the MatchResult objects, or could this be considered for a future update? Is there something off about my code or a step I've missed?

Thank you for your time and consideration.

@nreinicke
Copy link
Collaborator

Thanks for reaching out!

The OsrmMatcher was introduced more of a proof of concept and we haven't been using it much in our own map matching applications. So, it hasn't received much attention beyond the initial writing of it. That being said, it's cool to hear that you're getting some traction out of it.

It does look like OSRM returns geometry from their API and we actually have a todo to get that injected into the match results.

I can put together an issue for finishing the work on that and hopefully we can release that feature in the near future. And, if you're interested in taking a stab we always welcome contributions 😄

@joshuacroff
Copy link
Author

@nreinicke thank you for your work on the library! It's been very helpful for work I'm doing to conflate GPS data to networks quickly and somewhat painlessly! It's a complex issue as you know. ;). Thanks for opening an issue! I'll take a look at the code and see if I might be able to roll my sleeves up and contribute on this feature.

@nreinicke
Copy link
Collaborator

@joshuacroff that sounds great! I started the issue #182 but let me know if I can expand on anything there.

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

No branches or pull requests

2 participants