Skip to content

Instantly share code, notes, and snippets.

View eightysteele's full-sized avatar

Aaron Steele eightysteele

View GitHub Profile
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
{
"type":"Polygon",
"coordinates":[
[
[
16.171875,
-53.4357192066942
],
[
-165.5859375,
[[[[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
# A sample writing a BlobProperty to an external file.
# (Note: not a BlobReferenceProperty.)
- model: models.Attachment
connector: csv
connector_options:
encoding: utf-8
columns: from_header
property_map:
- property: __key__
external_name: ID
DEBUG [org.gbif.ipt.config.IPTModule$1] - GET /registry/thesauri.json HTTP/1.1
DEBUG [org.gbif.ipt.config.IPTModule$1] - GET /vocabulary/iso/639-2.xml HTTP/1.1
DEBUG [org.gbif.ipt.utils.HttpUtil] - Successfully downloaded http://rs.gbif.org/vocabulary/iso/639-2.xml to /Users/eighty/Desktop/IPT/config/.vocabularies/http_rs_gbif_org_vocabulary_iso_639-2_xml.vocab
INFO [org.gbif.ipt.service.admin.impl.VocabulariesManagerImpl] - Successfully loaded Vocabulary: ISO 639-2 Language Codes
DEBUG [org.gbif.ipt.service.admin.impl.VocabulariesManagerImpl] - Saving uri2url vocabulary map with 1 entries ...
DEBUG [org.gbif.ipt.config.IPTModule$1] - GET /vocabulary/iso/3166-1_alpha2.xml HTTP/1.1
DEBUG [org.gbif.ipt.utils.HttpUtil] - Successfully downloaded http://rs.gbif.org/vocabulary/iso/3166-1_alpha2.xml to /Users/eighty/Desktop/IPT/config/.vocabularies/http_rs_gbif_org_vocabulary_iso_3166-1_alpha2_xml.vocab
INFO [org.gbif.ipt.service.admin.impl.VocabulariesManagerImpl] - Successfully loaded Vocabulary: ISO 3166-1 Alph
#!/usr/bin/env python
#
# Copyright 2010 Map Of Life
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
dude:MOL-git eighty$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 3 commits.
#
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: app/COL.pyc
# deleted: app/png.pyc
class Tile(webapp.RequestHandler):
def post(self):
self.get()
def get(self):
url = self.request.path_info
png_data = TileService.get_png_tile(url)
if png_data:
self.response.headers['Content-Type'] = 'image/png'
self.response.out.write(png_data.getvalue())
#!/usr/bin/env python
#
# Copyright 2011 Map Of Life
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
package org.bg.server;
import java.io.IOException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.appengine.repackaged.com.google.common.collect.ImmutableMap;
import com.google.gson.Gson;