Skip to content

Instantly share code, notes, and snippets.

Avatar

Charlie Hofmann Lefrak mappingvermont

View GitHub Profile
View building_intersections.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mappingvermont
mappingvermont / endpoint.geojson
Last active Apr 21, 2020
Finding best-fit zoom level given a shapely geometry
View endpoint.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mappingvermont
mappingvermont / format_election_results.py
Last active Jan 23, 2020
script to format tabular election CSV to GIS attribute table - all joining to county FIPS code
View format_election_results.py
import pandas as pd
import geopandas as gpd
def clean_source_data():
df = pd.read_csv('countypres_2000-2016.csv')
# remove year 2000 election results
df = df[df.year != 2000]
@mappingvermont
mappingvermont / cant_build_area.geojson
Created Sep 25, 2019
Example polygons that return null from Sieve(geom, <any_number>)
View cant_build_area.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mappingvermont
mappingvermont / dc_how_16th_st.geojson
Last active Sep 12, 2019
Houses of Worship on 16th St, DC
View dc_how_16th_st.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View stockton.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View admin0.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mappingvermont
mappingvermont / example_geom.geojson
Created Aug 9, 2019
river / bay example from the division table
View example_geom.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View germany.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mappingvermont
mappingvermont / notes.txt
Created Nov 20, 2018
Bash one-liners of interest
View notes.txt
bash one-liners
get list of GLAD geostores in the last 30 days
gcloud logging read "(resource.type="container" AND resource.labels.cluster_name="wri-prod" AND resource.labels.namespace_id="default" AND resource.labels.container_name="forest-change" AND textPayload:(geostore))" --freshness 30d | grep glad | grep -v .py | grep -o 'geostore=.*' | cut -f2- -d= | cut -d'&' -f1 | sort | uniq
now need to do the same except for download from that dataset - download/3bec70f3-136b-4046-80c6-2a05afd741c6
gcloud logging read "(resource.type="container" AND resource.labels.cluster_name="wri-prod" AND resource.labels.namespace_id="default" AND logName="projects/resource-watch/logs/document" AND jsonPayload.src.func = "toSQLMiddleware" AND ("geostore" AND "lat"))" --freshness 30d | grep geostore
# gdal_translate
You can’t perform that action at this time.