Skip to content

Instantly share code, notes, and snippets.

View eightysteele's full-sized avatar

Aaron Steele eightysteele

View GitHub Profile
#!/usr/bin/env bash
__wrap__() {
# ............................................................................
# b3d
if hash conda 2>/dev/null; then
conda init >/dev/null 2>&1
conda deactivate >/dev/null 2>&1
#!/usr/bin/env bash
__wrap__() {
# ............................................................................
# b3d
if hash conda 2>/dev/null; then
conda init >/dev/null 2>&1
conda deactivate >/dev/null 2>&1
#!/usr/bin/env bash
__wrap__() {
printf "\n→ authenticating gcloud...\n\n"
gcloud auth login --update-adc --force --launch-browser
}
__wrap__
[[[[97.27517700195341, 5.170501232147274], [97.27518463134794, 5.169960975646973], [97.27241516113287, 5.170225143432731], [97.27462768554682, 5.171059131622371], [97.27517700195341, 5.170501232147274]]], [[[96.87304687500006, 5.252779960632495], [96.88083648681646, 5.249169826507682], [96.88083648681646, 5.248060226440373], [96.86916351318376, 5.251665115356673], [96.87304687500006, 5.252779960632495]]], [[[96.8538360595706, 5.255243778228817], [96.85416412353521, 5.255000114441202], [96.85415649414068, 5.25474023818964], [96.8538360595706, 5.255243778228817]]], [[[96.97778320312506, 5.262540817260856], [96.9755172729495, 5.118659973144531], [97.00924682617193, 5.101820945739746], [97.01476287841803, 5.054989814758414], [97.051010131836, 4.997011184692383], [97.09883117675798, 5.035748958587874], [97.1601181030274, 5.147384166717586], [97.23561859130865, 5.151420116424617], [97.4868621826173, 5.244060039520377], [97.50253295898466, 5.211801052093449], [97.48826599121094, 5.211161136627254], [97.4896774291992
{
"type":"Polygon",
"coordinates":[
[
[
16.171875,
-53.4357192066942
],
[
-165.5859375,
SELECT SUM(count) as value, 'FORMA' as name,
'alerts' as unit, '500 meters' as resolution
FROM
(SELECT COUNT(*) AS count
FROM forma_api
WHERE date <= now() - INTERVAL '1 Months'
AND ST_INTERSECTS(ST_SetSRID(ST_GeomFromGeoJSON('{"coordinates": [[[["22.5000", "3.3380"], ["21.9727", "-7.8851"], ["32.8711", "1.7575"]]]], "type": "MultiPolygon"}'), 4326),
the_geom)
GROUP BY date, iso
ORDER BY iso, date) AS alias
# Global Forest Watch API
# Copyright (C) 2013 World Resource Institute
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
$ ogrinfo --version
GDAL 1.10.1, released 2013/08/26
$ ogrinfo sad_polygons_fixed_130823.kml
ERROR 4: ERROR Parseing kml sad_polygons_fixed_130823.kml :junk after document element on line 821498 at offset 6
ERROR 4: ERROR Parseing kml sad_polygons_fixed_130823.kml :junk after document element on line 821498 at offset 6
FAILURE:
Unable to open datasource `sad_polygons_fixed_130823.kml'
def trimmer(rec):
keep_keys = ['class', 'country']
for key in rec.keys():
if key not in keep_keys:
rec.pop(key)
return rec
{
"higherclassification":"Animalia; Chordata; Aves; Ciconiiformes; Laridae",
"family":"Laridae",
"stateprovince":"Oregon",
"catalognumber":"91774",
"networks":"ORNIS",
"lifestage":"adult",
"rank":8,
"month":"6",
"decimallongitude":"-124.03817",