Road Trees? Yes, we can!
- Country boundary polygon as available, e.g., at gadm.org
- Corresponding OpenStreetMap data extract (see download.geofabrik.de)
- Access to a routing engine, we experimented with local instances of Project OSRM and pgRouting.
- First we need to create the, so to speak, playground, i.e., grid of points which will be used in the construction of the isochrones. Among the plethora of possibilities, the simplest choice is probably to merely uniformly sample the interior of the country polygon in a suitable planar projection. In our experiments, we often employed the Web Mercator projection (EPSG:3857).
- Having constructed the points, it is time to do the "heavy lifting" and calculate the travel distance vector, each element of which gives the travel time from the corresponding grid point to the location of interest, and also the associated trajectories. In principle, it would be possible to achieve this by using any of the services such as Google Directions API or for example GraphHopper. However, in order to recover a fractal structure in the final image, the total number of grid points required can be rather large (at least in the order of tens of thousands). Since the associated cost of the mentioned services is in some or other way proportional to the number of queried locations, it is preferable to install a routing engine locally. The documentation of the Project OSRM contains detailed instructions how to proceed with the installation on a variety of systems as well as description on how to then run the service.
With functional routing engine, it is rather straightforward to feed it the grid points and obtain the desired travel-distance vector. For example with OSRM, one can profit from the possibility to query the engine in "batch mode" with the table service. However, in order to get also the trajectories, one has to resort to the route service which amounts to performing one call per grid point. Nevertheless, one can run several instances of the routing engine on top of the same data set and thus in this way parallelize the calculation.
- With this, we have finally all the necessary information for producing plots as in our gallery!