1

I am well aware that this question was asked many times and i've spent days looking through stackoverflow answers but couldn't find anything that goes behind workarounds.

The problem is pretty simple: we need to show exact routes passed by the car (so, from GPS long/lat history data) on google maps and the routes are hundreds or even thousands kms long. What that mean is that we will always exceed waypoints limits by at least an order of magnitude (8 for free or 25 for premium). My gut is telling me that batching GPS locations to batches of 8/25, sending many requests that way and then snap all of those to roads and at the end merge all together into a single route is a bit wild solution.

If we are on a highway then its not that big problem since snap and expected/calculated route will work but if some long route is a combination of highway but also in-town drive through small streets with alot of turning, then i can imagine huge discrepancy between an actual (from raw GPS data) and shown route.

I am wondering if i am missing something? Is there some 'more proper' way to approach this problem?

PS. I don't need any code at the moment, just a proper way to architecture the idea.

Thanks

[UPDATE] To put a few numbers into the mix: 1) average route distance is about 1800kms 2) number of raw GPS points generated is about 15000-18000 (every 100-150 meters) 3) number of points that the route must go through (waypoints) is in at least in hundreds and sometimes in thousands (when most of the route is in urban areas)

dee zg
  • 13,793
  • 10
  • 42
  • 82

2 Answers2

1

One possible solution is the Roads API.

Related questions:

Issues

  1. The Roads API doesn't seem ready for prime time (reports of inconsistent results in the issue tracker)

  2. has a limit of 100 points at a time with a (not documented) recommended maximum separation of 400m (reference a comment under the answer to Google Map Road API not interpolating path and not giving smooth route).

Community
  • 1
  • 1
geocodezip
  • 158,664
  • 13
  • 220
  • 245
0

You could render the routes as images yourself and load them as an overlay layer on top of google maps. For example in my website we render weather forecast layers and add them as layers on top of the base map:

http://www.weather.gr/en/maps.aspx

kagelos
  • 423
  • 8
  • 19
  • Thanks for your response. I am not sure it addresses the same problem, though. From my understanding, your weather application renders custom markers (each having its GPS lat/long attached). In my case, i need to show the route that must pass through certain marker point (in other words, waypoints). And, while your app requirements don't have limits (you can have as many markers as you want) there is a limitation when it comes to waypoints (8 or 25, depending on google plan of choice). – dee zg May 21 '16 at 09:00
  • I suppose a route is a list of way points connected together, effectively making a polyline. I am suggesting you create a server side script that renders these polylines into transparent images, which you can then plot on top of google maps. There is no limit then. – kagelos May 21 '16 at 09:02
  • OK I am sorry, I may have misunderstood: You don't have the whole route, but you want Google to calculate the route for you? – kagelos May 21 '16 at 09:03
  • well, yes and no. you did understand correctly that i DO have many GPS points reported from GPS tracking device (for the whole route). What i want is to show all those points as route + snapped to roads. so, the route i want to show is what google maps return me for my list of GPS points + snapped to roads. but what i want to avoid is that googles expected route between 2 points differs from actual points passed (in my GPS raw data). My understanding is that is exactly what Waypoints are made for. – dee zg May 21 '16 at 09:07
  • rendering polylines myself on the server doesn't solve the problem in a sense that i can connect raw GPS dots wherever, client or server. But my problem is that i want to show route snapped to roads, not just polylines between my points. Plus, i want to make sure that route returned from SnapToRoads does pass through my points (some smoothing might take place but that's a separate topic not too relevant at the moment). – dee zg May 21 '16 at 09:12