UK Map Generator
UK map image generator
This application is used to generate a map of the UK showing counties and routes walked within them counties, the resulting uk_map.png file, his intended call from within a web page, and viewable online. This tool is quite capable of generating maps for any country, not just the UK.
A strong point of this tool, is that the entire map is rendered from data, and that the Python scripts can be rerun and global changes implemented. This is viewed as better than an editor, where an image can be tweaked, but then never regenerated.
sources to generate the uk_map.png map can be found in
P:\DevelopmentCode\Python\AllCountiesWalks
Two separate Python files are used to generate the uk_map.png file,
- generate_counties_info.py
``` Builds a set of vectors which detail the boundary limits, boundary names and positioning of those names, these are stored in a file called counties.geojson It uses a file boundary_hints.csv, which provides boundary names and positioning of those names. This takes time to run and is viewed as an infrequent action. ```
- generate_uk_map.py
``` It uses the output from the first, and overlays on it a set of routes already walked held in .\routes_walked , and routes planned to be walked held in .\routes_to_be_walked ```
This is illustrated below:
``` P:\DevelopmentCode\Python\AllCountiesWalks │ ├── generate_counties_info.py │ │ │ ├── Uses: boundary_hints.csv │ │ (boundary names + label positions) │ │ │ ├── Uses: .\historic_counties_gpx\ │ │ (boundary positions for counties) │ │ │ └── Generates: counties.geojson │ (county vectors + boundaries + names/positions) │ └── generate_uk_map.py │ ├── Uses: counties.geojson <-- output of generate_counties_info.py ├── Uses: .\routes_walked\ <-- completed routes ├── Uses: .\routes_to_be_walked\ <-- planned routes │ └── Generates: (Final web-facing) uk_map.png (map of UK counties + routes overlayed - formatted for viewing online) ```
Example boundary_hints.csv file
``` # Expected folder structure: # # ./historic_counties_gpx -> GPX files for county borders # ./routes_walked -> GPX files for walking routes # boundary_hints.csv -> CSV with filename and label positioning hints # # justification – affects horizontal alignment of the text: # # L → left # R → right # C → center # # horizontal – determines horizontal position of the label within the county boundary: # # L → left # R → right # M → middle # # vertical – determines vertical position of the label within the county boundary: # # T → top # M → middle # B → bottom # # filename , boundary_colour , justification, horizontal, vertical, text_colour, text_background Aberdeen.gpx , pink , L , R , M , white , green Aberdeenshire.gpx , red , L , R , M , white , green Anglesey.gpx , blue , R , L , M , white , green Angus.gpx , green , M , M , M , white , green ```
Example Generated UK Page
WALKS / RAMBLES
ENGLAND
Avon
Bedfordshire
greensandridgewalk.gpx (Ampthill to Clophill) 7 miles
Public Transport:
Train from Bletchley to Flitwick (~30 mins), walk to Ampthill (~1.5 miles or local bus).
Return from Clophill by bus to Flitwick, then train back.
Berkshire
Buckinghamshire
Train to Luton - Bus to Bletchley Park
Bletchley Park
Milton Keynes boundary walk (Milton Keynes Boundary Walk.gpx) look at local bus routes to determine start/end
Can I go to the start of the greensandridgewalk and then walk back to Milton Keynes?
Cambridgeshire
Cheshire
Cleveland
Cornwall
County Durham
Cumbria
Derbyshire
Devon
Lyme Regis (visit only)
Dorset (2025)
Weymouth to the Smugglers Inn, Osmington Mills / South Dorset Ridgeway
The X53 bus service runs from Exeter to Abbotsbury, stopping at Swyre which is just north-west of West Bexington.
The X53 also runs from Osmington to Weymouth, where you can pick up trains to Dorchester.
Essex
Gloucestershire
Hampshire
Herefordshire
Hertfordshire
Isle of Wight
Kent
Lancashire
Leicestershire
Lincolnshire
London (Greater London)
Saturday, 24th May 2025
Buy Day Return to London Bridge, catch 9.28 from Brighton Station ( 9.32 Preston Park). Walk across bridge to Eastcheap, catch No 15 bus to Limehouse Station. Walk via Regent's Canal ( coffee stop), Hertford Union Canal, Victoria Park ( caf� or picnic).
Then Lea River and Limehouse Cut ( tea stop)..
Return by No 15 bus.
Merseyside
Middlesex
Norfolk
North Humberside
North Yorkshire
Northamptonshire
Northumberland
Nottinghamshire
Oxfordshire
Shropshire
Somerset
South Humberside
South Yorkshire
Staffordshire
Suffolk
Surrey
Sussex
Tyne and Wear
Warwickshire
West Midlands
West Yorkshire
Wiltshire
Worcestershire
SCOTLAND
Neptune’s Staircase, Banavie, near Fort William
Aberdeenshire
Angus
Argyll
Ayrshire
Banffshire
Berwickshire
Caithness
Clackmannanshire
Dumfriesshire
Dunbartonshire
East Lothian
Fife
Inverness-shire
Isle of Arran
Isle of Barra
Isle of Benbecula
Isle of Bute
Isle of Canna
Isle of Coll
Isle of Colonsay
Isle of Cumbrae
Isle of Eigg
Isle of Gigha
Isle of Harris
Isle of Iona
Isle of Islay
Isle of Jura
Isle of Lewis
Isle of Mull
Isle of North Uist
Isle of Rhum
Isle of Scalpay
Isle of Skye
Isle of South Uist
Isle of Tiree
Kincardineshire
Kinross-shire
Kirkcudbrightshire
Lanarkshire
Midlothian
Morayshire
Nairnshire
Orkney
Peeblesshire
Perthshire
Renfrewshire
Ross-shire
Roxburghshire
Selkirkshire
Shetland
Stirlingshire
Sutherland
West Lothian
Wigtownshire
WALES
Clwyd
Dyfed
Gwent
Gwynedd
Mid Glamorgan
South Glamorgan
Powys
West Glamorgan
NORTHERN IRELAND
County Antrim
County Armagh
County Down
County Fermanagh
County Londonderry
County Tyrone