I am trying to generate random points on a route from one point to another. What I have till now is, given a source and a destination, I can get a route using Google's API. But how do I get the coordinates of random points on the route?
Tell me more
×
Geographic Information Systems Stack Exchange is a question and answer site for
cartographers, geographers and GIS professionals. It's 100% free, no registration required.
|
I'm not sure what tool you are using, but look into linear referencing methods. For example, if you are using PostGIS, here are 10 random points along a linestring:
Or if using Shapely:
|
|||
|
|
Write a function that returns total length of a route, and another that interpolates a point at an arbitrary distance along a route. Use a random number generator that generates a random distance |
|||
|
|