convenience (462 pts)

There are several locations in Aomori Prefecture (้’ๆฃฎ็œŒ) where a park, a convenience store, and a supermarket exist within approximately 100 metres of each other. This can also be confirmed on OpenStreetMap.

Answer the Way Number (on OpenStreetMap) of the southernmost of these parks that satisfy this condition.

The definition of "park" conforms to that classified as leisure=park on OpenStreetMap.

Flag Format: Diver25{123456789}

Hint:

  • Regarding the example of "exist within approximately 100 metres of each other", refer to the attached image.

The challenge is basically a test of OverpassTurboarrow-up-right scripting skills. As someone who relies on GPT, this is a though one xD. At the end, I wasn't able to create an elegant script that satisfies all condition with 100% certainty, but the script found the correct solution anyways. Here's how the algorithm works:

  • Get all convenience store in Aomori

  • Get all supermarkets within 100m of the convenience stores above

  • Get all parks within 100m of the supermarkets above

As you can see, with the filters listed above, the condition of "100 metres of each other" will be satisfied, but the code will also satisfy a condition where the park is NOT within 100 meters to the convenience store. So, if the code does not find the solution, some manual checkings are needed. Luckily, the code was able to find the correct solution.

[out:json][timeout:60];

// Define Aomori prefecture
area["name"="้’ๆฃฎ็œŒ"]["admin_level"="4"]->.aomori;


// Get all conv in Aomori
(
  node["shop"="convenience"](area.aomori);
  way["shop"="convenience"](area.aomori);
  relation["shop"="convenience"](area.aomori);
)->.convs;

// Get supermarkets within 100m of any conv
(
  node["shop"="supermarket"](around.convs:100);
  way["shop"="supermarket"](around.convs:100);
  relation["shop"="supermarket"](around.convs:100);
)->.nearby_sups;

// Get parks within 100m of any supermarket
(
  node["leisure"="park"](around.nearby_sups:100);
  way["leisure"="park"](around.nearby_sups:100);
  relation["leisure"="park"](around.nearby_sups:100);
)->.nearby_parks;


// Output all
(
  .nearby_parks;
);
out body;
>;
out skel qt;

Flag: Diver25{556701681}

Last updated