GeoWizard was the first person to attempt to cross a country in a straight line and upload the journey to YouTube. Perservering through failures and tough terrain is a hallmark of their multiple attempts. This has inspired many other people to cross various geographical regions worldwide. The most important part of this is choosing the two points to connect with a straight line. Having crossed the Peak District and New Forest multiple times manually planning the line, I knew that there was a more efficient way that could take advantage of the open geographical data available.
With the idea of planning the most efficient straight line across a given region, I planned the architecture and methodology for the code. The method is:
Step 1. Import the region as a .kml file which can be made using Google Earth.
The inital step involves the user defining their region in Google Earth and saving as a standard recognised file type. This gives flexibility to be able to cross any arbitrary region.
Step 2. Call the OpenStreetMaps API for features, ground type, and land use in the region.
This is where the power of open datasets is shown. The collaborative open-source project of OpenStreetMaps is a great tool for geographical analyses. The API returns the features such as motorways, railways, and rivers that act as additional constraints.
Step 3. Rasterize this, giving a penalty to tougher to cross areas such as dense forest and marsh.
The region is divided into a n by n metre grid defined by the user with the penalty for each cell being evaluated based on the OSM data. The user can choose their grid resolution based on their needs, and penalties by how they cross the different land types.
Step 4. Find the optimal line that crosses the region, the line with the lowest penalty.
Two methods have been written. The simpler technique evaluates thousands of randomly connected points on the region edge, allowing for a minimum length so that the line isn't just 50m down the region boundary, and actually crosses the area. The second uses the A* path-finding algorithm to find the optimal path that stays within a 25m wide line. Staying within 25m is a platinum straight line score.