#!/bin/sh # Fetch a boundary file! # # Author: Dan Jacobson https://www.jidanni.org/ # Copyright: https://www.gnu.org/licenses/gpl.html # Created: 2023-09-04 # Last-Updated: 2023-09-07T09:05:53+0000 # Update #: 4 # I found a site where this is less of a mess: set -ue osm_relation_id=$1 mapit_id=$( curl --silent --fail-with-body --show-error --location \ https://global.mapit.mysociety.org/code/osm_rel/$osm_relation_id | perl -nwle '/\d+/ && print $&;') curl --silent --fail-with-body --show-error https://global.mapit.mysociety.org/area/$mapit_id.kml -o $1.kml