Openstreetmap / Overpass Part 2 Openstreetmap / Overpass Part 2

May 16, 2021

openstreetmap

Downloading the data for features in Greater London

Yesterday, I uploaded the demo map and got a buggy version of the OSM map working showing the data stored on a map. I wanted to explore what is actually stored in the system already so I got this query to extract multiple tags (website, twitter, facebook) in one overpass-turbo query.

node[~"^(website|twitter|facebook)$"~"."]  ({{bbox}});
out;

This file was exported as .geojson and I then wrote a php script to extract those 3 elements and count them. using json machine

<?php
use \JsonMachine\JsonMachine;

require 'vendor/autoload.php';

$counter = 0;
$features = JsonMachine::fromFile('websiteTwitterFacebook.geojson');

foreach ($features as $key=>$value) {
    if ($key=="features"){
        foreach ($value as $feature){
            echo $feature['properties']['@id'];
            echo " ";
            if(isset($feature['properties']['website'])) {
                echo $feature['properties']['website'];
            }
            echo " ";
            if(isset($feature['properties']['twitter'])) {
                echo $feature['properties']['twitter'];
            }
            echo " ";
            if(isset($feature['properties']['facebook'])) {
                echo $feature['properties']['facebook'];
            }
            echo PHP_EOL;
            $counter++;
        }
    }
}
echo "total: ". $counter;
?>

Total entries with any of the three elements was around 16,000, mainly with websites entries only. This data included some phone numbers and other things:

+44 20 3912 9400
+44 20 7584 1363
+44 20 7584 8918
+44 20 7589 0046
+44 20 7589 8851
+44 20 7730 0085
+44 20 7937 5033
+44 20 8743 0336
+44 20 8749 9977
155
400rabbits.co.uk/
HTTP://EVERESTSPICE.CO.UK
Henry Mayhew
IDMestates.com
La Cantina Sociale
Www.popnrest.com
htpps://www.lowerladysden.co.uk
http://countdown.tfl.gov.uk/#|searchTerm=blackstock road|stopCode=49525
https://docs.google.com/spreadsheets/d/12cLkm_p2ovnebNhQm4NmuTV9A6N6FZgg1SpUZ8phuq0/edit?usp=sharing
leicestersquare@allbarone.co.uk

But apart from these and a few similar ones i removed from the list, it was mainly websites.


If you would like to contact me you can either use this form on londinium.com or via Twitter @andylondon