Footprint SVGs - goodformandspectacle/londonmuseums GitHub Wiki

Here's an overview of how the footprint SVGs were generated.

Overpass Query

The Overpass Turbo wizard can be used to find 'tourism=museum in "Greater London"'. The resulting query can be modified slightly yield center points, and to output "raw" OSM XML. See overpass_center_query.txt. In Overpass Turbo: Export > raw data to get OSM XML.

Extract Ways

Museum footprints (ways) can be extracted (or expanded) from OSM XML and output as a simple list, a full, detailed dump, or as only the SVG data. The output can be written to a CSV file, or into individual SVG data files. See extract_ways.py -h.

usage: extract_ways.py [-h] [-csv CSVFILE] [-svg DATA_DEST]
                       overpass_xml {list,dump,svg}

Extract ways from OSM XML and emit by size.

positional arguments:
  overpass_xml          Overpass API XML output
  {list,dump,svg}       output format

optional arguments:
  -h, --help            show this help message and exit
  -csv CSVFILE, --csvfile CSVFILE
                        write CSV list to specified file.
  -svg DATA_DEST, --data-dest DATA_DEST
                        write SVG data files to specified directory.

For example, write CSV:

$ ./extract_ways.py overpass_center.xml list -csv overpass_center_ways.csv
wrote 5353 bytes to overpass_center_ways.csv

write svgdata:

$ ./extract_ways.py overpass_center.xml svg -svg svgdata
wrote 477 bytes to svgdata/151996457.json
wrote 423 bytes to svgdata/80278329.json
wrote 1481 bytes to svgdata/268533442.json
...

Make Footprints

Footprints can be generated from the stack of SVG data files. See make_footprints.py -h and make_way.js.

usage: make_footprints.py [-h] csv data dest

Write ann SVG file foreach svgdata input found

positional arguments:
  csv         Overpass CSV (from extract_ways)
  data        SVG input data directory (from extract_ways)
  dest        SVG destination directory

optional arguments:
  -h, --help  show this help message and exit

For example

$ make_footprints.py overpass_center.xml svgdata svg

@siznax