Skip to content

About

Contributions to geohub data collection, aiming to automate file updates and maintain a log of last updates. CoP: Data Science: Create district types reusable tool (API, single dataset, etc.) #118

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

GeoHub LA Data Collection

Note: This repository is an off-shoot of the following repository: https://github.com/parcheesime/geohub-datacollection. It is issue 118 Create District Types for Hack for L.A. Data Science CoP.

Overview

This project collects district boundary files for various political and administrative districts within Los Angeles County.
The data is converted into both raw JSON and GeoJSON formats for easy use in civic tech projects.
The processed data will be contributed to Hack for LA.

The processed outputs are automatically uploaded to a shared Google Drive, making the latest district files easily accessible for civic-tech and data-science use.

For questions or collaboration, reach out on GitHub: @parcheesime.

Scheduled workflow note

This workflow runs monthly using GitHub Actions. GitHub may automatically disable scheduled workflows in public repositories after a period of repository inactivity. If shapefile updates stop appearing in Google Drive, check whether the workflow has been disabled and re-enable it from the Actions tab.


Districts Covered

  • Assembly
  • Senate
  • Neighborhood Councils
  • Supervisors
  • Congressional
  • City Clerk (BIDs)
  • City Council

Data Collection Process

The data collection process is facilitated using the GeoHub LA County Website and related ArcGIS APIs.

Steps

  1. Authentication: No key required.
  2. Requesting Data: Python script sends requests to API endpoints for each district.
  3. Data Processing: Responses are saved in two formats:
    • Raw ArcGIS JSON (district.json)
    • GeoJSON (district.geojson)
  4. Data Storage: Output files can be locally stored in shapefiles_output/.
  5. Automation: A GitHub Actions workflow will be configured to run this process on a weekly or monthly basis via main.yml.
  6. Data Upload: Output files are automatically uploaded to a shared Google Drive, making the latest district files easily accessible for civic-tech and data-science use.

Repository Structure

geohubLA_data_collection/

│

├── main.py # Script to fetch and save district shapefiles

├── main.yml # GitHub Actions workflow file saves shapefiles in drive

├── shapefiles_output/ # Folder where JSON and GeoJSON outputs are stored locally

├── example_usage.ipynb # Jupyter notebook demo of loading and plotting data

├── requirements.txt # Python dependencies

└── README.md # Project documentation

Installation & Setup

Clone the repository

git clone https://github.com/<your-org>/geohubLA_data_collection.git
cd geohubLA_data_collection

Installation & Setup

Create and activate a virtual environment

python3 -m venv myenv
source myenv/bin/activate

install requirements

pip install -r requirements.txt

Run main and example usage

python main.py
jupyter notebook example_usage.ipynb

About

Contributions to geohub data collection, aiming to automate file updates and maintain a log of last updates. CoP: Data Science: Create district types reusable tool (API, single dataset, etc.) #118

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages