flott / cso_digitalocean

King County real-time CSO status in GeoJSON format

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

King County Real-Time CSO Status

Requires geojson.

Background

Reads the CSO status from King County's web server and combines it with a CSV file of the point coordinates, then creates a GeoJSON file of the current CSO status for King County and Seattle.

The resulting GeoJSON file can be added to a webmap.

Example CSO status data from King County's server:

	CSO_TagName,04-01-2016 09:30:01 AM
	11TH.CSOSTATUS_N,3
	30TH.CSOSTATUS_N,3
	NPDES072,3
	...

The coordinates (lat, lon, EPSG 3857) are in a CSV file.

	CSO_TagName,X_COORD,Y_COORD,Name,DSN
	ALKI,-122.4225,47.57024,King County CSO: Alki,051
	ALSK,-122.406947,47.559442,King County CSO: Alaska St SW,055
	...

Output

The current CSO status is zipped up with the coordinates and properties for each CSO location. Properties included are:

Property Value
CSO_TagName Name code for CSO location
DSN Data Source Name
Name Long name for CSO location
Time_stamp Timestamp of most recent query
CSO_Status CSO status code (1 - 4)
Description Description of CSO status code.
  1. Overflowing now
  2. Overflowed in the last 48 hours
  3. No recent overflow
  4. Data not available
marker-color
  1. Red
  2. Yellow
  3. Green
  4. Grey
marker-symbol
  1. square
  2. triangle
  3. circle
  4. cross
marker-size
  1. large
  2. medium
  3. small
  4. small

Running with cron

Make sure that both cso_status_geojson.py and update_cso_status.sh are executable. (chmod +x). Modify the paths in update_cso_status.sh to reflect where the repo was cloned.

Then use crontab -e to set up the cron job. The example below will run every 15 minutes (at :00, :15, :30, and :45):

	*/15 * * * * /home/fred/github/cso_digitalocean/update_cso_status.sh # KC_CSO

About

King County real-time CSO status in GeoJSON format

License:MIT License


Languages

Language:Python 93.4%Language:Shell 6.6%