title: Create a CSV file of all the addresses in an area from OSM file
body: <p>I am interested in creating a CSV file of addresses from the area below (in the format <strong>street name, town, postcode, city, latitude, longitude</strong>).</p>
  
  <p><img src="https://i.stack.imgur.com/XDeK4.png" alt="enter image description here"></p>
  
  <p><strong>This is what I've done so far:</strong></p>
  
  <p>1) Download osm files for the UK at <a href="http://nick.dev.openstreetmap.org/downloads/planet/" rel="nofollow noreferrer">http://nick.dev.openstreetmap.org/downloads/planet/</a></p>
  
  <p>2) Run osmfilter:</p>
  
  <pre><code>osmfilter uk.osm --keep="highway=residential =primary =secondary =tertiaty =unclassified" &gt;uk_streets.osm
  </code></pre>
  
  <p>3) Run osmconvert:</p>
  
  <pre><code>osmconvert uk_streets.osm --csv="@lon @lat addr:city addr:street" --csv-headline --csv-separator=, -o=uk_streets.csv
  </code></pre>
  
  <p><strong>My problems</strong></p>
  
  <ul>
  <li><p>I can't figure out how to only pull addresses from the Milton Keynes
  area, the above script seems to pull from the whole of UK (i.e. not in
  the bounds shown in the image above).</p></li>
  <li><p>There were lots of gaps in the data after running the script, I could
  not find some of the addresses that appeared on the OSM website in
  the database </p></li>
  </ul>
  
  <p><strong>Question</strong></p>
  
  <ul>
  <li>How would I refactor my osmfilter and osmconvert
  commands to pull the necessary information for the Milton Keynes
  area ONLY?</li>
  </ul>