Skip to content

Instantly share code, notes, and snippets.

Avatar

Dave Martin djtfmartin

View GitHub Profile
@djtfmartin
djtfmartin / export_of_raw_db_fields_2018-06-13.txt
Created Jun 13, 2018
export_of_raw_db_fields_2018-06-13.txt
View export_of_raw_db_fields_2018-06-13.txt
_class
abcdIdentificationQualifier
abcdIdentificationQualifierInsertionPoint
abcdTypeStatus
acceptedNameUsage
associatedMedia
associatedOccurrences
associatedReferences
associatedSequences
associatedTaxa
@djtfmartin
djtfmartin / export_of_db_fields_2018-06-13.txt
Created Jun 13, 2018
export_of_db_fields_2018-06-13.txt
View export_of_db_fields_2018-06-13.txt
_class
_qa
abcdIdentificationQualifier
abcdIdentificationQualifier_p
abcdIdentificationQualifierInsertionPoint
abcdTypeStatus
acceptedNameUsage
associatedMedia
associatedOccurrences
associatedOccurrences_p
View gist:5064a77eeb7533e2d23d26c446ca51a0
import groovy.json.JsonSlurper
statusUrl = new URL("http://XXXXXXXX:8983/solr/admin/collections?action=clusterstatus&wt=json")
slurper = new JsonSlurper()
json = slurper.parseText(statusUrl.text)
collectionName = "biocache"
println("Parsing")
View gist:3a98a0f4339adea3444cf1ff761b18a1
package au.org.ala.biocache.tool
import au.org.ala.biocache.Config
import org.slf4j.LoggerFactory
object FixDatePrecision extends au.org.ala.biocache.cmd.Tool {
def cmd = "fix-date-precision"
def desc = "Cleanup old date precision values."
View gist:4a639e601ba4f156a8953c69cfbafef7
2017-09-20 02:07:07,477 INFO [GbifRegistryService] Updating GBIF organisation dp46: 8dda5e56-c4b4-4af2-90f9-170d9d22f2c1
2017-09-20 02:07:08,179 INFO [GbifRegistryService] Setting GBIF country of attribution to AU
2017-09-20 02:07:09,030 INFO [GbifRegistryService] Successfully updated provider in GBIF: 8dda5e56-c4b4-4af2-90f9-170d9d22f2c1
2017-09-20 02:07:09,839 INFO [GbifRegistryService] Removing contacts
2017-09-20 02:07:10,670 INFO [GbifRegistryService] Removed contact 615477
2017-09-20 02:07:10,671 INFO [GbifRegistryService] Successfully synced contacts: 8dda5e56-c4b4-4af2-90f9-170d9d22f2c1
2017-09-20 02:07:10,674 INFO [GbifRegistryService] Creating GBIF resource for dr797
2017-09-20 02:07:10,674 INFO [GbifRegistryService] Creating dataset in GBIF: null
2017-09-20 02:07:10,674 WARN [GbifRegistryService] Unable to register dataset - please check license: dr797 : Whicher Scarp Flora Survey : other
2017-09-20 02:07:10,674 INFO [GbifRegistryService] Registry key not set for resource: dr797. Not sy
View loading_nvc_table.sql
create table nvc_scotland (pid integer, name varchar(255), the_geom geometry, the_geom_4326 geometry);
insert into nvc_scotland(pid, name, the_geom)
SELECT nextval('objects_id_seq'::regclass), commun_cat, ST_UNION(the_geom) FROM "65" where commun_cat='A, Aquatic Communities' GROUP BY commun_cat;
insert into nvc_scotland(pid, name, the_geom)
SELECT nextval('objects_id_seq'::regclass), commun_cat, ST_UNION(the_geom) FROM "65" where commun_cat='W, Woodlands' GROUP BY commun_cat;
# Doesnt return.....
insert into nvc_scotland(pid, name, the_geom)
View NVC SQL
delete from "65" where COMMUN_CAT IS NULL;
update "65" set COMMUN_CAT = 'A, Aquatic Communities' where COMMUN_CAT='A';
update "65" set COMMUN_CAT = 'CG, Calciolous Grassland' where COMMUN_CAT='CG';
update "65" set COMMUN_CAT = 'H, Heathland' where COMMUN_CAT='H';
update "65" set COMMUN_CAT = 'M, Mires' where COMMUN_CAT='M';
update "65" set COMMUN_CAT = 'MC, Maritime Cliff Communities' where COMMUN_CAT='MC';
update "65" set COMMUN_CAT = 'MG, Mesotrophic Grassland' where COMMUN_CAT='MG';
update "65" set COMMUN_CAT = 'N/A, Non-standard code' where COMMUN_CAT='N/A';
update "65" set COMMUN_CAT = 'S, Swamps and tall-herb fens' where COMMUN_CAT='S';
update "65" set COMMUN_CAT = 'OW, Open Water' where COMMUN_CAT='OW';
View gist:4395dd91d377d35f1a5e61e806e6b791
[
{
"speciesGroup": "Mammals",
"taxonRank": "order",
"taxa": [
{
"name": "DASYUROMORPHIA",
"common": "Carnivorous Marsupials"
},
{
View gist:8977528215f949d10557f259314656d5
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">62</int>
<lst name="params">
<str name="qt">standard</str>
View eol-specieslist
Talpa europaea
Vulpes vulpes
Abies cephalonica
Abies cilicica
Abies concolor
Abies delavayi
Abies firma
Abies fraseri
Abies grandis
Abies homolepis