Skip to content

Instantly share code, notes, and snippets.

@gabrieldance
gabrieldance / cut_out_states.rb
Last active August 29, 2015 14:07
cut out states from country shapefile
require 'csv'
states = CSV.read('states_w_regions.csv',headers:true)
states.each do |state|
puts(state["id"], state["abbreviation"])
`ogr2ogr -f "ESRI Shapefile" -sql "select * from cb_2013_us_county_500k where cast(STATEFP as integer(2)) = #{state["fips_state"]}" cb_2013_#{state["abbreviation"]}_county_500k.shp ../cb_2013_us_county_500k.shp`
end
@gabrieldance
gabrieldance / l8get
Last active August 29, 2015 14:12 — forked from briantjacobs/l8get
# This is a shell function to quickly grab the data for a given Landsat 8 tile ID from Google's servers
# For example:
# l8get LC81690352014169LGN00
# The echo at the end is to remind myself of the syntax for extracting bands 8, 4, 3, and 2. (Pansharp, Red, Green, Blue)
# On OSX this would go into your ~/.bash_profile file.
# Requires gsutil from https://developers.google.com/storage/docs/gsutil_install
# Most useful in conjunction with USGS' Earth Explorer: http://earthexplorer.usgs.gov/
this.breakScale=chroma.scale([lowColor,'#ff0b3a'])
.domain([1, 114, 258, 481, 2105])
.correctLightness(true)
@gabrieldance
gabrieldance / keybase.md
Created January 10, 2019 22:40
keybase public gist

Keybase proof

I hereby claim:

  • I am gabrieldance on github.
  • I am gabrieldance (https://keybase.io/gabrieldance) on keybase.
  • I have a public key ASAg765fFB_Kj4Nj7jgbj_u--eMizlIftSw3ckrT64kk4Ao

To claim this, I am signing this object: