Skip to content

Instantly share code, notes, and snippets.

View andrewxhill's full-sized avatar

Andrew W. Hill andrewxhill

View GitHub Profile
class MasterSearch(db.Model): #key = term
layers = db.ListProperty(db.Key) #all layers it corresponds to
db.get(db.Key.from_name('MasterSearch','puma'))
class OccurrenceSetIndex(db.Model): #parent = OccurrenceSet see below
term = db.CategoryProperty() #string values to search for sets
rank = db.RatingProperty(default=0) #weight of term for an order by
class OccurrenceSet(db.Model): #key_name = ecoregion/wwf/puma_concolor or something
name = db.StringProperty() #this could be non-unique, Puma concolor is fine
source = db.StringProperty() #wwf
type = db.StringProperty() #ecoregion
info = db.BlobProperty() #some meta standard for sets of occ polygons
dateCreated = db.DateTimeProperty(auto_now_add=True)
MetaDataProfile( #key=xab
basic = {name = 'MOL Range Maps',
references = 'Ole Bess',
spatial = 'spatial stuff'
},
detailed = 'lots more info'
profile = 'a real EML profile'
}
class Javascript(webapp.RequestHandler):
def get(self,file):
ref = self.request.referer
if ref == "" or 'javascript/' in ref:
jspath = 'source'
else:
jspath = 'mini'
self.response.headers['Content-Type'] = "application/json"
self.response.out.write(template.render('%s/%s.js' % (jspath,file), {}))
AmphLink
MasterID,Species_ID,Sp_code,Genus,Species,FileName,Scientific,SynonymsForBioInv
OS: key = protected/wdpa/specid
name = genus species
subname = WDPA Bioinventory
source = WDPA
SumAmph
WDPA2009_all,SITE,MasterID,Species_ID,Scientific
OI: key = wdpa2009column
OS = protected/wdpa/specid
@andrewxhill
andrewxhill / collectionsmetadata.json
Created May 19, 2011 00:50 — forked from tucotuco/collectionsmetadata.json
Third pass at collections metadata JSON from Andrew
{
"collection":{
"source":"World Wildlife Fund (WWF)",
"type":"Ecoregion",
"name":"World Ecoregions",
"description":"The WWF's Conservation Science Program (CSP) has developed a biogeographic regionalization of the Earth's terrestrial biodiversity. WWF termed the biogeographic units ecoregions, defined as relatively large units of land or water containing distinct assemblages of natural communities sharing a large majority of species, dynamics, and environmental conditions. Ecoregions represent the original distribution of distinct assemblages of species and communities.",
"url":"http://www.worldwildlife.org/science/ecoregions/item1267.html",
"agreements":{
"0":{"url": "http://www.worldwildlife.org/agreement.html"
"text": "A brief overview of the TOS",
{
"source":"World Wildlife Fund (WWF)",
"type":"Ecoregion",
"name":"Admiralty Islands lowland rain forests",
"description":None,
"storage":{
"location":"/ftp/ecoregion/shp/AA0101.shp",
"format":"esri-shape"
},
"spatial":{
{
"source":"IUCN Global Mammal Assessment",
"type":"Range",
"name":"Puma concolor",
"description":None,
"storage":{
"location":"/ftp/range/shp/animalia/species/puma_concolor.shp",
"format":"esri-shape"
},
"spatial":{
{
"source":"World Wildlife Fund (WWF)",
"type":"assemblage list",
"name":"Admiralty Islands lowland rain forests",
"description":None,
"temporal":{
"creation": "2001-03-02T00:00Z",
"upload": "2011-05-25T18:11Z",
"coverage": {
"start": "1990-01-01T00:00Z",
@andrewxhill
andrewxhill / gist:1041819
Created June 23, 2011 03:05
Python Commmplish API Signature
import md5
#the API Secret for your Project
secret = '9393c2df-e1c8-457c-adc1-a5b75210d52f'
#the User email address you querying (all lowercase)
email = '[email protected]'
#concatenate the two parameters
sig_string = secret + email