Code Monkey home page Code Monkey logo

cities's Introduction

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"

cities's People

Contributors

jameschevalier avatar h4ck3rm1k3 avatar

Watchers

Andrew Wang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.