Skip to content

Instantly share code, notes, and snippets.

View thomas-maschler's full-sized avatar

Thomas Maschler thomas-maschler

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'/>
<title>Tree Cover Loss 3.0 Vector Tiles POC</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no'/>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.1.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.1.0/mapbox-gl.css' rel='stylesheet'/>
<style>
body {
from pathlib import PurePath
import subprocess as sp
from parallelpipe import stage
import logging
import glob
import sys
@stage(workers=96)
def calc(cabon_tiles, area_tiles):
@thomas-maschler
thomas-maschler / lbr_landcover.json
Created August 6, 2018 14:55
Liberia Land Cover Composition Widget
{
"$schema": "https://vega.github.io/schema/vega/v4.0.json",
"width": 240,
"height": 240,
"padding": 2,
"title": {
"text": "Land Cover Composition",
"font": "Fira Sans",
"fontSize": 16,
"offset": 20,
@thomas-maschler
thomas-maschler / total_area.json
Last active August 3, 2018 14:24
Total areas of combined restoration potential
{
"$schema": "https://vega.github.io/schema/vega/v4.0.json",
"width": 240,
"height": 140,
"padding": 2,
"data": [
{
"name": "histogram",
"format": {
"property": "histograms[0].counts"
@thomas-maschler
thomas-maschler / mapbuilder.json
Created August 1, 2018 15:32
Mapbuilder example JSON
{
"webmap": "0ef9a90ee2cb48bb9b66bbcc6831278e",
"title": "ETHIOPIA TREE-BASED LANDSCAPE RESTORATION POTENTIAL ATLAS",
"subtitle": "Ministry of Environment, Forest & Climate Change",
"logoUrl": "http://mefcc.gov.et/wp-content/uploads/2017/09/ministry-of-environment-forest-and-climate-change-logo7.png",
"logoLinkUrl": "http://mefcc.gov.et/",
"aboutLinkUrl": "",
"downloadLinkUrl": "",
"printServiceUrl": "https://gis.forest-atlas.org/server/rest/services/print/ExportWebMap/GPServer/Export%20Web%20Map",
"mapThemeIds": "",
@thomas-maschler
thomas-maschler / signal_url.json
Created July 26, 2018 03:10
using signal in URL
{
"$schema": "https://vega.github.io/schema/vega/v4.json",
"width": 400,
"height": 200,
"padding": 5,
"title": "population trend",
"signals": [
{
"name": "Species",
"value": "Loxodonta cyclotis",
@thomas-maschler
thomas-maschler / tree_cover_density.json
Last active August 3, 2018 14:22
Restoration portentential per tree cover density class
{
"$schema": "https://vega.github.io/schema/vega/v4.0.json",
"width": 240,
"height": 75,
"padding": 2,
"title": {
"text": "Tree Cover",
"font": "Fira Sans",
"fontSize": 16,
"offset": 0,
@thomas-maschler
thomas-maschler / rainfall_classes.json
Last active August 3, 2018 14:26
Restoration potential per Rainfall Classes
{
"$schema": "https://vega.github.io/schema/vega/v4.0.json",
"width": 240,
"height": 75,
"padding": 2,
"title": {
"text": "Average Annual Rainfall",
"font": "Fira Sans",
"fontSize": 16,
"offset": 0,
@thomas-maschler
thomas-maschler / population_density.json
Last active August 3, 2018 14:28
Restoration potential per population density analysis widget
{
"$schema": "https://vega.github.io/schema/vega/v4.0.json",
"width": 240,
"height": 75,
"padding": 2,
"title": {
"text": "Population Density",
"font": "Fira Sans",
"fontSize": 16,
"offset": 0,
@thomas-maschler
thomas-maschler / landcover.json
Last active August 3, 2018 14:29
Restoration potential per land cover widget
{
"$schema": "https://vega.github.io/schema/vega/v4.0.json",
"width": 240,
"height": 75,
"padding": 2,
"title": {
"text": "Land Use-Land Cover",
"font": "Fira Sans",
"fontSize": 16,
"offset": 0,