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

MapMatching API Question - Android #1378

Closed
Danny-James opened this issue Oct 2, 2018 · 7 comments
Closed

MapMatching API Question - Android #1378

Danny-James opened this issue Oct 2, 2018 · 7 comments

Comments

@Danny-James
Copy link

I am in need of some help in regards to the MapMatching API, I understand you can pass in a Maximum of 100 Coordinates per request, this is fine, All my routes have much more than 100 Coordinates which is fine as i then call

fetchRoute(List<Point> coordinates, boolean showProgress, boolean routeFromCurrentLocation) 

Each time this is called and a route is returned i remove 100 coordinates from my Master List, so when the onArrival(); event is triggered I check to see if the master list still has coordinates to be routed if so, re call fetchRoute(); and so on.

However, with this i've come across some routes where the last coordinate in the route lands on a Intersection or Traffic Island which is then not giving correct voice instructions.

What i would like to do is still pass in 100 coordinates but reroute when the user arrives at coordinate 90 of the plotted route, i will then remove those 90 from the master list and pass in an additional 90 coordinates.

However, i'm not able to see anything which will tell me when the user has reached the 90th Coordinate passed into the MapMatching API.

@danpat
Copy link

danpat commented Oct 3, 2018

@Danny-James Knowing the logic that sits behind calculating the banner and voice instructions, I think you're going to have trouble stitching multiple Map Matching requests together - it'll throw off the distance/offset timing calculations.

Your best bet will probably be to request overlapping map-matching traces. Most of the inconsistency you'll find, as you've discovered, will happen at the start/end of the trace where there is special behaviour. If you can request overlapping traces, you can then trim the start/end sections, and join the results at the point where they become equal. It'll take some fiddly comparisons and array splicing, but I think it's the most likely approach to work without too many edge cases.

Also note that we do offer higher coordinate limits if you sign up for an Enterprise account.

@Danny-James
Copy link
Author

@danpat so is their no way of knowing when the user has reached the 90th coordinate in the navigation?

What are the maximum requests if i signup for the enterprise on average our KML files contain around 1500 coordinates.

@Danny-James
Copy link
Author

@danpat I'm not to bothered about the distance/time as i'm not showing the bottom banner, i'm only showing the top banner which shows turn icons and street names etc.

So i believe if i know when the user reaches the 90th coordinate or what ever i choose to set as the fetch next lot of coordinates i will be able to workaround the issue where a set of 100 coordinates lands on a intersection or traffic island.

@danpat
Copy link

danpat commented Oct 3, 2018

@Danny-James You'd have to do some of the math there yourself. I believe the Android SDK has durationRemaining and distanceRemaining properties on the route you're following. You can do some calculations on your original data to figure out the point where your 90th coordinate resides, the compare to the progress updates from the SDK itself.

Maximum limits for Enterprise accounts can be negotiated. 1500 coords is definitely something we can technically do, but I'm just a lowly engineer, I don't actually know how much our sales folks would try to charge for that capability.

@Danny-James
Copy link
Author

I will look at doing some calculations with disatance remaining as this seems to be the only option here, i did try adding an additional Waypoint into the request but this basically causes the same problem.

@danpat I don't know whether you could help with the NavigationMap Route Line, i plot a Polyline on the map of the whole route (1500 coordinates) when i run the navigation i get a darker blue line for the 100 coordinates.

This darker blue line i believe is the NavigationMapRoute, this line also contains Turn arrows which i would like to keep however i would like to hide the NavigationMapRoute.

I do have an issue open but don't seem to have had a response for some time. #1293

@danpat
Copy link

danpat commented Oct 3, 2018

@Danny-James Sorry - I don't know that much about the Nav SDK itself - I work primarily on the backend algorithms related to routing and matching - UI stuff is not my forté.

Can this ticket be closed?

@Danny-James
Copy link
Author

@danpat yes go ahead and close this ticket, my plan of action is to have a variable of which Coordinate i want to initiate the new route fetch varX.

I will then calculate the distance from the Last Coordinate in the map matching to the varX when the users remainingDistance lands within X distance force a refetch.

Thanks, for your input on this @danpat

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