Tool to enrich datasets containing location information with district information.
The use case for this utility is to take historical data for City of Austin 311 service requests and add a column with council district.
This utility was developed during ATX Hack for Change II, May 31 - Jun 1, 2014. atxhackforchange.org/
“district-enricher” is a command line utility.
It reads a CSV file on the local system. It assumes the first row of the input is column titles. The dataset must contain latitude and longitude columns. The column titles are not needed; “district-enricher” will discover them automatically.
“district-enricher” copies each row of input to its output, adding one column entitled “Calculated Council District” at the end of the row. The district is calculated using the latitude/longitude information in the row.
Example:
(Grab the "Unified 311" dataset (big!!) from the City of Austin data portal.) $ wget https://data.austintexas.gov/api/views/i26j-ai4z/rows.csv (Produce dataset enriched with council district info.) $ district-enricher -v rows.csv rows-enriched.csv
You can test the utility with the “data/example-311_unified_data.csv” test dataset included in the package. If the enrichment works, the results should match “data/example-311_unified_data-enriched.csv”
Use the “-b” option for help.
This utility requires the following Ruby gems:
-
rgeo - github.com/rgeo/rgeo
-
rgeo-shapefile - github.com/rgeo/rgeo-shapefile
You can install the pre-requisites by running:
$ bundle install
On my system (Fedora release 19), I had to install the following package before building the Ruby Gems to satisfy dependencies:
-
geos-devel
Please use the issue tracker at:
github.com/chip-rosenthal/district-enricher/issues
Chip Rosenthal chip@unicom.com