Skip to content

Instantly share code, notes, and snippets.

@briantjacobs briantjacobs/l8get forked from dwtkns/l8get
Last active Aug 29, 2015

Embed
What would you like to do?
# 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/
function l8get() {
id="$1"
path=${id:3:3}
row=${id:6:3}
yr=${id:9:4}
gsutil cp gs://earthengine-public/landsat/L8/$path/$row/$id.tar.bz .
echo ""
echo "tar -jxvf *.tar.bz '*_B[4328].TIF'"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.