Giter Site home page Giter Site logo

dedupe's Introduction

Dedupe

Code for deduplicating OpenAddresses data, currently U.S. English only. Outputs CSV files with rows for matched groups of addresses and point features for unmatched single addresses.

In this example image of Butte, MT dark-colored linestrings show addresses that have been matched between county and statewide sources, while magenta dots show addresses that have not been matched all. This shows that most normal addresses in Butte are correctly deduped between county and statewide sources:

Butte, MT

Sample Usage

Sample usage to install required packages, download 100,000 rows of sample data from OpenAddresses, and generate a set of CSV files using GNU Parallel:

$ pip3 install -r requirements.txt
$ ./address-areas.py /dev/stdout | head -n 100000 | ./address-map.py > 100k-filenames.txt
$ parallel -a 100k-filenames.txt ./expand-reduce.py '{}' '{.}.csv'

Addresses are deduped within the areas found in geodata/areas.shp matching U.S. Census defined CBSA's and excluded state areas.

California and Nevada

Advanced Usage

$ apt-get install parallel
$ ./split-areas.py > split-areas.txt
$ parallel -a split-areas.txt ./address-areas.py --areas '{}' '{.}.txt'
$ parallel -a split-areas.txt  ./address-map.py '{.}.txt' | sort | uniq > area-filenames.txt
$ parallel -a area-filenames.txt ./expand-reduce.py '{}' '{.}.csv'

Sample Times

These samples were all run on a Virtualbox virtual machine: Ubuntu 14.04, 1x CPU, 2GB memory, Python 3.4, and PostGIS.

All of Santa Clara Valley:

  • 728,279 address rows.
  • 52,629 comparison tiles sorted.
  • 477,829 output features: 228,134 (65.5%) merged.

Southwestern Montana:

  • 376,003 address rows in 0:35 minutes (57% cpu).
  • 252,644 comparison tiles sorted in 1:15 minutes (19% cpu).
  • 228,426 output features: 135,896 (63.9%) merged in 1:32 minutes (56% cpu).

All of Montana:

  • 1,011,515 address rows in 1:37 min (59% cpu).
  • 702,745 comparison tiles sorted in 3:29 min (20% cpu).
  • 603,294 merged features: 335,835 (66.8%) merged in 36:23 min (21% cpu).

Merging took a long time when expand-reduce.py thrashed on low physical RAM. Running this in parallel would solve the problem.

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.