Poly files for cities, which can be used to create OSM files out of larger regions
Switch branches/tags
Nothing to show
Clone or download
Latest commit a45f370 Dec 5, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
australia add australia Jul 23, 2014
austria Removed some empty files, renamed some files, and Something Happened Aug 1, 2014
belgium add belgium, new zealand, and portugal Oct 30, 2015
bosnia_and_herzegovina remove bad poly files Jan 31, 2015
brazil Removed some empty files, renamed some files, and Something Happened Aug 1, 2014
canada add some more cities in Canada Dec 5, 2018
colombia update colombia Oct 28, 2015
costa_rica add some cities Mar 26, 2016
czech_republic Removed some empty files, renamed some files, and Something Happened Aug 1, 2014
denmark add denmark Oct 11, 2015
finland Removed some empty files, renamed some files, and Something Happened Aug 1, 2014
france Removed some empty files, renamed some files, and Something Happened Aug 1, 2014
germany minor formatting update to match other files Nov 14, 2018
hungary add Hungary Dec 5, 2018
iceland add iceland Oct 29, 2015
images update readme & its images Jun 18, 2013
india add india Dec 6, 2014
ireland add ireland Jul 23, 2014
israel remove incorrect file Aug 6, 2014
italy add italy Nov 28, 2014
japan/tokyo add tokyo, japan Jan 31, 2015
mexico add mexico Oct 28, 2015
netherlands Removed some empty files, renamed some files, and Something Happened Aug 1, 2014
new_zealand add belgium, new zealand, and portugal Oct 30, 2015
norway Removed some empty files, renamed some files, and Something Happened Aug 1, 2014
poland add poland Oct 29, 2015
portugal add belgium, new zealand, and portugal Oct 30, 2015
singapore/singapore add singapore Oct 28, 2015
slovenia add slovenia Mar 4, 2016
south_africa add south africa Mar 1, 2016
spain add a couple cities Sep 27, 2016
sweden Removed some empty files, renamed some files, and Something Happened Aug 1, 2014
switzerland Removed some empty files, renamed some files, and Something Happened Aug 1, 2014
united_arab_emirates fix name Dec 4, 2018
united_kingdom add united_kingdom Jul 28, 2014
united_states add some CT cities Dec 5, 2018
README.md remove note about OSM files Apr 6, 2018

README.md

cities

This is a collection of .poly files for cities, with the definition of 'city' being the area one level under the region/state level. There isn't a whole lot of concern here for discrepancies between cities, towns, villages, etc.

These .poly files are used to then extract just the city's OSM file from a greater region's OSM file. For example, creating an exact OSM file for Boston from the North America OSM file. More information on actually using the .poly files is provided at the bottom of this document.

The ultimate goal is to have them all, but it's a rough process right now. The process explained below shows how to retrieve the .poly file for a specific city, but the process I've gone through to gather most of the files in this repository is much more automated and uses Overpass Turbo.

How To Get The Poly File For A Specific City

Sometimes a city won't have a Relation ID, or the Relation that exists will be broken. For those instances, the final OSM file can be created manually by tracing the city at http://extract.bbbike.org/. Just make sure to select one of the 'OSM XML' formats in the top pulldown menu there.

  • Go to http://nominatim.openstreetmap.org/ and search for the city you'd like added

  • Click the 'details' link for that city in the left column

  • Make sure that the map on the right displays the full city border

  • Copy the number for 'OSM: relation'

  • Go to http://polygons.openstreetmap.fr/, paste the number into the form, and click the Submit button

  • Click the 'poly' link to open the file in the browser, then use File -> Save As to save the file

  • The naming convention I've been using is city-name_state-abbreviation.poly. For example, holyoke_ma.poly

How To Use The Poly File

You can use the .poly file to extract that region from a greater region's OSM file.

  • Install Osmosis
    • If you're on a Mac, I suggest you use Homebrew to install it with brew intsall osmosis
  • Download the .osm.pbf file for the region that the city is in from http://download.geofabrik.de/
  • Run this to extract the city's OSM file out of the greater region's OSM file: osmosis --read-pbf-fast file="YOUR-REGION-latest.osm.pbf" --bounding-polygon file="CITY-NAME_STATE.poly" --write-xml file="CITY-NAME_STATE.osm" For example: osmosis --read-pbf-fast file="north-america-latest.osm.pbf" --bounding-polygon file="holyoke_ma.poly" --write-xml file="holyoke_ma.osm"