Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Miami-Dade County Address + Building (+POI?) Import

Software tools and technical description of the Miami-Dade OSM import in 2018

Largely based on the 2016 Large Building Import. Tool/documentation still under construction.


Python 2.7.

Install PostgreSQL with PostGIS on your system. You can find some help here.

You will also need the psycopg2 and requests python packages.

Install osmosis with apt-get install osmosis on Ubuntu/Debian (other platforms see

Install GDAL/OGR for your system. Used for importing shapefiles to Postgres with ogr2ogr.

PLUS osmconvert, ogr2osm, ...

Download the data files from here:

Building Footprint 2D -
Address with condo -
Census Tracts -

Data preparation

  • Create a PostgreSQL database and make sure user 'postgres' with the password 'postgres' has access to it. Until the code is cleaned, osm_test is hardcoded in some cases. We will make the code base f more flexible so that it can be easily used for other imports.
  • Set up the DB (extensions, tables)
python data_prep/ --setup

Get the data

  • Import shapefiles to db. (I store the shapefiles in a folder called data. Pass it as the first argument) to the following shell script. This step uses ogr2ogr to populate the address_with_condo and building_footprint_2d tables in Postgres.
./data_prep/ data

The following steps import current OSM data to the same database.

  • Grab OSM buildings from OverpassAPI (store them in osm_buildings table)
python data_prep/ --buildings_download
  • Grab OSM Addresses from OverpassAPI (osm_addresses table)
python data_prep/ --address_download
  • Grab OSM highways/railways from OverpassAPI (osm_highway_railway)
python data_prep/ --roads_download

Prepare the data for processing/conversion

  • Get rid of duplicate addresses in the import dataset (i.e. condo units).
python data_prep/ --dedupe_address
  • Add some extra fields to tables.
python data_prep/ --add_fields
  • Convert closed linestrings from Overpass to Polygon
python data_prep/ --convert_poly
  • Create spatial indexes to ensure that spatial queries are effective. Update databaes statistics.
python data_prep/ --index_data
python data_prep/ --vacuum

Data processing

  • Check import addresses against OSM adddresses. Flag those in the proximity of existing addresses and exclude them.
python data_prep/ --check_address
  • Check import buildings against OSM buildings. Flag those intersecting with existing buildings and exlude them.
python data_prep/ --check_building
  • Check buildings crossing highway and railway features. Add fixme=highway/railway crosses building
python data_prep/ --check_road_rail
  • Assign address to buildings where there is only one overlapping address point (or there is only one within 5 meters)
python data_prep/ --assign_address

Data conversion

  • Get rid of unnecessary nodes using the Douglas-Peucker algorithm (tolerance: 0.3 meters)
python data_prep/ --simplify
  • Clone ogr2osm in parent directory
cd ..
git clone --recursive
  • Navigate back to the project folder
  • Generate test datasets. Data files for all tract polygons: use tract
cd data_conversion
./ test


Data processing workflow and tool for the Miami-Dade OSM Import in 2018




No releases published


No packages published