Coder Social home page Coder Social logo

metrozd's Introduction

MetroZD - Metro ZipCode Database

This gem contains a rakefile that will generate a metro zipcode database.

Why is this useful? Metro areas are useful for locating population areas. So useful infact the USPS charges for access to this database. I found myself in need of it for two projects. I’m currently getting my data off wikipedia by hand. I hope someone more skilled with web scrappers can write one that can keep the database more upto date.

Install

gem install metrozd git => 'git://gems.github.com/jbwyatt4/metrozd'

Usage

To generate the model and populate your rails apps.

bundle exec rake db:metro:create

bundle exec rake db:metro:populate

To remove the table.

bundle exec rake db:metro:drop

Contributing

You can add a metro area by city by adding a handleCityEntry(..) to the populateData function. An example

handleCityEntry("New York-Northern New Jersey-Long Island","New York City","NY", 10000..10499, 11004..05, 11100..11499, 11600..11699)

This function can handle an unlimited number of zipcodes (ranges or integer). Since according to the USPS zipcodes change all the time (at least in growing areas) using a function makes it easier to change.

Goals

Limitations

  • The database can be optimized. Instead of duplicating the metro, city, state with each zipcode you can just use an id and a relation. However i’m not sure how to generate a relationship automatically without going deeper into generators.

  • Wikipedia. We get our data from wikipedia… nuff said. But honestly it’s probably good enough and I think alot of people will enjoy a gem version of a needed database.

License

Copyright © 2012 John B. Wyatt IV LGPL v3+ by the Free Software Foundation. To make it easy for everyone by contributing to this repository you agree to license said contributions under these terms.

metrozd's People

Contributors

jbwyatt4 avatar claretdragon avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.