{"id":17928460,"url":"https://github.com/alifeee/service-stations","last_synced_at":"2026-03-19T02:30:47.535Z","repository":{"id":258880619,"uuid":"874863587","full_name":"alifeee/service-stations","owner":"alifeee","description":"map of service stations in the uk and Ireland from https://motorwayservices.uk/","archived":false,"fork":false,"pushed_at":"2024-11-14T17:12:59.000Z","size":796,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-22T11:14:00.325Z","etag":null,"topics":["geojson","postcodes","service-station"],"latest_commit_sha":null,"homepage":"https://geojson.io/#data=data:text/x-url,https%3A%2F%2Fraw.githubusercontent.com%2Falifeee%2Fservice-stations%2Frefs%2Fheads%2Fmain%2Fservice-stations-all.geojson","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alifeee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-18T15:44:52.000Z","updated_at":"2024-11-14T17:13:03.000Z","dependencies_parsed_at":"2024-11-14T17:35:38.658Z","dependency_job_id":null,"html_url":"https://github.com/alifeee/service-stations","commit_stats":null,"previous_names":["alifeee/service-stations"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alifeee/service-stations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fservice-stations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fservice-stations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fservice-stations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fservice-stations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alifeee","download_url":"https://codeload.github.com/alifeee/service-stations/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fservice-stations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28526571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geojson","postcodes","service-station"],"created_at":"2024-10-28T21:03:08.326Z","updated_at":"2026-03-19T02:30:47.518Z","avatar_url":"https://github.com/alifeee.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [!CAUTION]\n\u003e MOVED! see \u003chttps://git.alifeee.net/service-stations/about/\u003e\n# service-stations\n\nmap of service stations in the uk from \u003chttps://motorwayservices.uk/\u003e and Ireland from \u003chttps://motorwayservices.ie/\u003e\n\nview map on geojson.io: \u003chttps://geojson.io/#data=data:text/x-url,https%3A%2F%2Fraw.githubusercontent.com%2Falifeee%2Fservice-stations%2Frefs%2Fheads%2Fmain%2Fservice-stations-uk.geojson\u003e\n\nview map on Google Maps: \u003chttps://www.google.com/maps/d/u/0/edit?mid=1llayKM-EKG17ENDg8x-3_Xv6-yNkTxU\u0026usp=sharing\u003e\n\nsee more maps on \u003chttps://alifeee.co.uk/maps/\u003e\n\n![screenshot of map showing many markers, one is expanded](./images/map.png)\n\nalso view on Google Maps / OSMAnd / Bing Maps / etc with...\n\n## Import to different apps\n\n### Google Maps\n\ncreate a custom map ([how?](https://www.google.com/maps/about/mymaps/)) and import the `.kml` file above.\n\n### OSMAnd\n\nImport as places to \u003chttps://osmand.net/\u003e, by downloading the `.gpx` file and uploading it to places.\n\n### Apple Maps\n\nnot sure yet...\n\n## Generation\n\n### UK Services\n\n```bash\n# get all possible pages from motorway services site\nwget \"https://motorwayservices.uk/elements/sitemap.xml\" -O sitemap.xml\n# format sitemap so there is one link per line\nsudo apt install libxml2-utils \nxmllint --format sitemap.xml \u003e sitemap_reformatted.xml\n# search for links that do not look like \"File:\" or \"History:\" etc\ncat sitemap_reformatted.xml | pcregrep -o1 \"(https://motorwayservices.uk/[^:\u003c/]*)\u003c/loc\u003e\" | sort -h | uniq \u003e pages.txt\n# save all sites from sitemap\nmkdir pages\nwhile read site; do name=$(echo \"${site}\" | sed 's/\\///g' | sed 's/https:motorwayservices.uk//g'); wget \"${site}\" -O \"pages/${name}.html\" --timeout=2 --tries=1; sleep 1; done \u003c\u003c\u003c $(cat pages.txt)\n# find postcodes from each HTML page, they look like:\n#   \u003c/div\u003e\u003cdiv class=\"infobyte2\" style=\"border-style:solid;border-color: #00A34B\"\u003e\u003cb\u003ePostcode:\u003c/b\u003e\n#   \u003cp\u003eLL57 4BG\npcregrep -ri \"\u003cp\u003e[A-Z]{1,2}[0-9]{1,2} ?[0-9]{1,2}[A-Z]{1,2}\" pages | pcregrep -o1 -o2 --om-separator=\",\" \"pages/(.*)\\.html.*\u003cp\u003e([A-Z]{1,2}[0-9]{1,2} ?[0-9]{1,2}[A-Z]{1,2})\" | sort -h \u003e postcodes.csv \n# get lat/long coords from postcode using API from https://www.doogal.co.uk/BatchGeocoding\n#   curl -s 'https://www.doogal.co.uk/GetPostcode/CV10%207DA' | jq '.latitude, .longitude' | paste -sd, -\nwhile read line; do postcode=$(echo \"${line}\" | csvtool col 2 -); pcurlencoded=$(echo \"${postcode}\" | sed 's/ /%20/g'); curl -s \"https://www.doogal.co.uk/GetPostcode/${pcurlencoded}\" | jq '.latitude, .longitude' | paste -sd, - | echo \"${line},\"$(cat /dev/stdin) | tee -a service-stations-uk.csv; done \u003c postcodes.csv\n# add URL to motorwayservices.uk\ncsvtool col 1 service-stations-uk.csv | sed 's/^/http:\\/\\/motorwayservices.uk\\//' | paste -d, service-stations-uk.csv - \u003e /tmp/coords\nmv /tmp/coords service-stations-uk.csv\n# add header to CSV\nsed -i '1s/^/name,postcode,latitude,longitude,URL\\n/' service-stations-uk.csv\n# create geojson (see https://gist.github.com/alifeee/60e121a4b55ce1069b003e1d94f0e046)\ngit clone git@github.com:pvernier/csv2geojson.git\n(cd csv2geojson/; go build main.go)\n./csv2geojson/main service-stations-uk.csv\n# file now is -\u003e service-stations-uk.geojson !\n```\n\n### Ireland services\n\n```bash\n# Irish site has no sitemap, but lists all services when you search for them, as there are not many\nwget \"https://motorwayservices.ie/Services_Search?reply=yes\u0026country=IE\u0026road=Any\u0026brands=Any\u0026operator=Any\u0026access=Any\u0026rating=None\u0026ratingt=All\" -O services_search.html\n# tidy HTML so that we can easily grep for links instead of parsing HTML\ntidy services_search.html \u003e temp.html; mv temp.html services_search.html\n# find all links in table\ncat services_search.html | pcregrep -o1 '\u003ctd.*\u003ca href=\"(.*)\"' | sort -h | uniq | sed 's/^/https:\\/\\/motorwayservices.ie/' \u003e pages.txt\n# save all sites locally\nmkdir pages\nwhile read site; do name=$(echo \"${site}\" | sed 's/\\///g' | sed 's/https:motorwayservices.ie//g'); wget \"${site}\" -O \"pages/${name}.html\" --timeout=2 --tries=1; sleep 1; done \u003c\u003c\u003c $(cat pages.txt)\n# get eirecodes from each page\npcregrep -ri \"\u003cp\u003e[A-Z0-9]{3} ?[A-Z0-9]{4}\" pages | pcregrep -o1 -o2 --om-separator=\",\" \"pages/(.*)\\.html.*\u003cp\u003e([A-Z0-9]{3} ?[A-Z0-9]{4})\" | sort -h \u003e service-stations-ie.csv\n# now, we cannot convert Eircodes to latlong coordinates easily, as Eircodes are proprietary(?)\n#  so, what I did was manually paste each Eircode into Google Maps, refresh the page (to centre the page on the pin), and copy the coordinates from the URL\necho \"do it manually :)\"\n# add URLs\ncsvtool col 1 service-stations-ie.csv | sed 's/^/http:\\/\\/motorwayservices.ie\\//' | paste -d, service-stations-ie.csv - \u003e /tmp/coords\nmv /tmp/coords service-stations-ie.csv\n# add header to CSV\nsed -i '1s/^/name,eircode,latitude,longitude,URL\\n/' service-stations-ie.csv\n# create geojson (see https://gist.github.com/alifeee/60e121a4b55ce1069b003e1d94f0e046)\ngit clone git@github.com:pvernier/csv2geojson.git\n(cd csv2geojson/; go build main.go)\n./csv2geojson/main service-stations-ie.csv\n# file now is -\u003e service-stations-ie.geojson !\n```\n\n### Combined file\n\nCombine the CSV files\n\n```bash\ncat service-stations-uk.csv | awk 'NR\u003e1{print}' \u003e service-stations-all.csv; cat service-stations-ie.csv | awk 'NR\u003e1{print}' \u003e\u003e service-stations-all.csv; sed -i '1s/^/name,postcode\\/eircode\\/etc,latitude,longitude,URL\\n/' service-stations-all.csv\n```\n\nWe can combine geojson files with \u003chttps://github.com/mapbox/geojson-merge\u003e\n\n```bash\nnpm install -g @mapbox/geojson-merge\ngeojson-merge service-stations-uk.geojson service-stations-ie.geojson  \u003e service-stations-all.geojson\n```\n\nCreate a gpx file using \u003chttps://products.aspose.app/gis/conversion/geojson-to-gpx\u003e or similar (search \"geojson to gpx\")\n\nCreate a kml file using \u003chttps://geojson.io/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falifeee%2Fservice-stations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falifeee%2Fservice-stations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falifeee%2Fservice-stations/lists"}