Skip to content

Instantly share code, notes, and snippets.

View albert-decatur's full-sized avatar

Albert Decatur albert-decatur

  • AidData
  • Williamsburg, VA, USA
View GitHub Profile
@albert-decatur
albert-decatur / example WKT from UL landsat-api corner
Last active August 29, 2015 14:19
landsat-api polar stereoscopic flip
scene=LC80231222014362LGN00; curl -s "https://api.developmentseed.org/landsat?search=${scene}" |jq '.results[]|[.upperLeftCornerLongitude,.upperLeftCornerLatitude]|@csv' | sed 's:"::g;s:,: :g;s:^:POINT( :g;s:$: ):g'
@albert-decatur
albert-decatur / See-scene.sh
Last active August 29, 2015 14:19
see landsat-api scene extents on geojson.io
#!/bin/bash
# see Development Seed landsat-api scene extent on geojson.io
# example use: $0 LC81660362014196LGN00
scene=$1
# get scene metadata from devseed landsat-api
curl -s "https://api.developmentseed.org/landsat?search=${scene}" |\
# get corner coords
jq '.results[]|[.lowerLeftCornerLongitude,.lowerLeftCornerLatitude,"",.lowerRightCornerLongitude,.lowerRightCornerLatitude,"",.upperRightCornerLongitude,.upperRightCornerLatitude,"",.upperLeftCornerLongitude,.upperLeftCornerLatitude,"",.lowerLeftCornerLongitude,.lowerLeftCornerLatitude]|@csv' |\
@albert-decatur
albert-decatur / batch-geocode.sh
Created November 24, 2010 19:15
collection of BASH scripts for GIS
#!/bin/bash
#geocode a CSV file using both Google and Yahoo! APIs, send output to either KMl or ESRI Shapefile
# example Yahoo geocode request: http://where.yahooapis.com/geocode?q=950+main+street,+Worcester,+ma&appid=[yourappidhere]
# example Google geocode request: http://maps.googleapis.com/maps/api/geocode/xml?address=950+main+st,+worcester,+MA&sensor=true
# get working directory
WORKING_DIR=`pwd`