Skip to content
Placeholder for some ideas about OpenStreetMap extracts
Shell Python JavaScript CSS
Latest commit a89f7f8 Jun 30, 2014 @migurski Linked to Mapzen
Failed to load latest commit information.
coastline-preview Added complete(ish) upload shellscript Dec 15, 2011
previews Added Bucharest, Romania by request Dec 10, 2013
Makefile new area calculation, pretty print area output Mar 29, 2013 Linked to Mapzen Jun 30, 2014
bbmap.js Cleaned up part of bbmap.js that was unused Mar 26, 2013 Compressed to fit within limits Feb 20, 2012 Switched back to older method of number formatting. Apr 14, 2013 Small path updates to and Mar 24, 2013 Updated with continent groups Mar 22, 2013
cities.txt Added Bucharest, Romania by request Dec 11, 2013 I guess these are in a different place now? Dec 8, 2013 Added Bucharest, Romania by request Dec 11, 2013 Updated design of index page with new CSS and new Mapquest Open style… Mar 24, 2013 Small path updates to and Mar 24, 2013
index.html Added note about Mapzen Jun 30, 2014 Added --no-kill option to Jan 29, 2012 check in missing file Mar 29, 2013 Added Bucharest, Romania by request Dec 11, 2013 Removed osm2pgsql tags that were too long for postgres column names Feb 10, 2012 Added Bucharest, Romania by request Dec 11, 2013 Updated run script with AMI and instance type we actually want to use Mar 22, 2013
style.css Added note about Mapzen Jul 1, 2014 Made file upload at the end an option but left default behavior on Feb 15, 2012


In one of my SotM 2011 talks, I suggested that OSM should have regular extracts of metropolitan areas for major world cities and their surrounding areas, regardless of state or country. This is a repository for a bit of code to make that real. I’ve decided to use Amazon S3 to host files, and EC2 to do the extracting. is a script that performs the actual work with Osmosis and terminates its host machine upon completion.

This collection is no longer maintained.

The fine folks at Mapzen have built a newer and more up-to-date version of Metro Extracts. Get data from and suggest changes at mapzen/metroextractor-cities.

Adding New Cities

Extractotron is run a few times per month, to If you have cities to add, you can add them directly to cities.txt and send me a pull request in Github.

cities.txt is a tab-delimited file, and has eight fields:

  • group

    One of "Africa", "Asia", "Europe", "Middle East", "North America", "South America", or Oceania.

  • geonameid

    It's nice to have a link back to the Geonames dataset.

  • top, left, bottom, right

    Geographic bounding box of the metropolitan area. These should be larger rather than smaller to surrounding countryside wherever possible. For example of coverage area, see Moscow.

  • slug

    Short, lowercase version of the name with dashes for spaces that's used for files.

  • name

    Full name of the city.

Rolling Your Own

To use Extractotron yourself, use

python <your AWS access key> <your AWS secret> <your bucket name>

By default, instantiates an m2.4xlarge instance with Alestic's Ubuntu 10.04 Lucid instance-store AMI ami-bffa6fd6. You can change the instance type or AMI, see python --help for details.

Currently, the cities list is very short. Help me expand it by modifying cities.txt and sending a pull request via Github.

Code Documentation

The Makefile generates various derived files from the cities.txt file. These scripts are utilities to do the extracts, generate utility scripts, JPG previews, and an HTML index based on the regions specified in index.html. Note the result of this Makefile is checked in at github so there's no immediate need to run make on a fresh clone of the repo.


    Generate the shell script which uses Osmosis to extract subsets of OSM based on the bounding boxes in cities.txt


    Generate the shell script which uses imposm to import generated OSM metro subsets into a PostGIS database.


    Generate the shell script which uses ogr2ogr to generate coastline shapefiles.


    Generate index.html, the current HTML interface to allow download of various extracted OSM data.


    Generate the JPG images in previews, snapshot maps of the various metros being extracted.

The scripts generated above are then used by Extractotron to generate the actual extracts. The code for doing the extracts includes


    Utility script to create an EC2 instance to run the extract. See above for details.


    Template for the shell script to do the extraction. substitutes pathnames for the scripts generated in the Makefile so that EC2 can then run the extraction. See also and

Something went wrong with that request. Please try again.