Determine furthest points away in a country for a specific set of points

Based on a set of locations (nodes) these scripts will try to figure out which points are the furthest away from these locations in a country.

It uses the following algorithm:

First it tries to find locations, which are potentially far away from our input set:

  1. It generates the Voronoi-graph based on the input set of locations
  2. It checks each of the generated vertices whether they are within the country's boundaries or not. Any point that's in the boundary gets added to the potential list of candidates
  3. Each of the vertices of the boundary are also added to the potential candidates list
  4. Finally any point on the boundary that is bisected by a Voronoi-edge is also added to the candidate list

The vertices of the Voronoi-graph are good candidates as they are the furthest point away from their neighbouring locations. However some of these points can be outside of the country's boundaries. To make sure they are also accounted for both the vertices in the country's boundaries are added to the list, as well as any place where the boundary was intersected by a voroni-edge. These are the points where distances are at a local maximum, so it's worth checking.

Once we have a set of potential locations, we simply go through them, find the nearest node to them, and check it's distance. Then we sort these nodes according to how large it's distance is.

To make the result not too clustered, we also remove points that are too close together at the end. This makes sure that remote border locations, which have a large amount of points in the search set will not be over-represented in the result, as we are interested in more distinct locations anyway.

Once we have the end values we render them to a map as well.

Note: the voronoi diagram is calculated using a metric on a plate carrée projection of longitude and latitude values, with an optional adjustment based on median latitude. For countries that span a large latitude range this might not be exact enough on the top and bottom part of the image, and might skew which points should be considered and which not. However distance calculations afterwards are done using great circle distances, so they should be accurate.

Download and usage

Please see https://github.com/sztupy/kossuth-map for more details

Examples

Points furthest away in Hungary from a street named "Kossuth"

Almost all settlements in Hungary have a street or square named "Kossuth". If you wish to be the furthest away from any of them, the best place is around the tripoint border between Hungary, Austria and Slovenia where you'll be 17km away from one.

On average, if you are in a random place in Hungary, it's likely you will be within 3km of a Kossuth street or square.

Interactive map (click)

Static map (click for large resolution image):

Kossuth large

You can also find data on other streets in this list:

Points furthest away in Hungary from any sports complex

There's plenty of sports complexes in Hungary. To be the furthest from one, you have to be just North-East of Hortobágy National Park in the middle of nowhere, where the closest complex will be a mere 12km away.

On average, if you are in a random place in Hungary, it's likely you will be within 3.5km of a Sports Complex.

Interactive map (click)

Static map (click for large resolution image):

Stadion large

The dataset is from a list I gathered for another project called Magyar Stadionok: https://github.com/sztupy/magyar-stadionok

Points furthest away in Great Britain from a pub

Also it's widely known that there are a lot of pubs in the UK. However there's not that many of them in the Highlands, you can actually be 72km from one if you go to the right spot (or, if you include Hirta Isle the distance is 80km).

The best you can do is 13km in Wales, and 11.8km in England (excluding Lundi Isle where it's 26km).

On average, if you are in a random place in Great Britain, it's likely you will be within one km of a pub

Interactive map (click)

Static map (click for large resolution image):

GB Pubs

Points furthest away in Scotland from a distillery

The Isles are left out from distilleries unfortunately, especially Shetland, where Unst is 240km away from the nearest distillery. On the mainland... well you have to head towards England to get 102km away from Scotch.

On average, if you are in a random place in Scotland, it's likely you will be within 15km of a Distillery

Interactive map (click)

Static map (click for large resolution image):

Scottish distilleries