Skip to content

alifeee/mountain-bothies

Repository files navigation

Mountain Bothies

Scraping of Mountain Bothie locations from the Mountain Bothie website https://www.mountainbothies.org.uk/bothies/location-map/.

Info output as geoJSON file -> bothies.geojson, for example,

...
{
    "type": "Feature",
    "properties": {
        "url": "https://www.mountainbothies.org.uk/bothies/northern-highlands/croft-house-lochstrathy/",
        "features": [
            "Open fire",
            "Strictly no vehicle access",
            "Dogs under strict control"
        ],
        "name": "Croft House (Lochstrathy)",
        "location": "Northern Highlands"
    },
    "geometry": {
        "type": "Point",
        "coordinates": [
            -4.066687736144918,
            58.412679049987325
        ]
    }
},
...

Load this file on any mapping software, such as https://geojson.io/.

Development

Requirements: Python 3

Install dependencies

pip install -r requirements.txt

Get bothies

py get_bothies.py

Convert data to geoJSON

py to_geojson.py

Map

You can visualise the geojson on Bing Maps using the index.html template. You need to fill in the following line with an API key you can get from https://learn.microsoft.com/en-us/bingmaps/getting-started/bing-maps-dev-center-help/getting-a-bing-maps-key

<script
    type="text/javascript"
    src="https://www.bing.com/api/maps/mapcontrol?callback=GetMap&key={{api_key}}"
    async
    defer
></script>

Alternatively, for a quick and dirty example, paste the geojson file into Bing's geojson example.

Screenshot of Bing Maps with markers on