Skip to content

Instantly share code, notes, and snippets.

View jmasselink's full-sized avatar
🏠
Working from home

Joel Masselink jmasselink

🏠
Working from home
View GitHub Profile
@jmasselink
jmasselink / water_combined.js
Last active October 15, 2024 19:30
Water detection in Sentinel Hub
//VERSION=3
const colorRamp = [[0, 0x000000], [1, 0xFFFFFF]]; // Color ramp for water detection (black for water)
let viz = new ColorRampVisualizer(colorRamp);
function setup() {
return {
input: ["B02", "B03", "B04", "B08", "B11", "dataMask"],
output: [
{ id: "default", bands: 4 }, // RGBA output for combined visualization
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jmasselink
jmasselink / gfw_alerts_to_csv.py
Created March 24, 2023 01:29
Converts Global Forest Watch integrated deforestation alerts to CSV output
# derived from a question to ChatGPT
# How could I use Python code to derive a CSV with 4 fields: longitude, latitude, date, and confidence level from a raster which has the following encoding/syntax?:
# Each pixel (alert) encodes the date of disturbance and confidence level in one integer value. The leading integer of the decimal representation is 2 for a low-confidence alert, 3 for a high-confidence alert, and 4 for an alert detected by multiple alert systems, followed by the number of days since December 31, 2014. 0 is the no-data value. For example:
# 20001 is a low confidence alert on January 1st, 2015
# 30055 is a high confidence alert on February 24, 2015
# 21847 is a low confidence alert on January 21, 2020
# 41847 is a highest confidence alert (detected by multiple alert systems) on January 21, 2020. Alert date represents the earliest detection
# 0 represents no alert
import rasterio
@jmasselink
jmasselink / GHA_adm1_regions.geojson
Created September 7, 2022 20:08
Ghana admin 1 level boundaries (16 regions)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jmasselink
jmasselink / Okapi_Wildlife_Reserve.geojson
Last active October 4, 2019 18:32
Okapi Wildlife Reserve extracted from World Database for Protected Areas
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jmasselink
jmasselink / PCT_overpass.geojson
Created June 10, 2019 15:35
PCT export from Overpass API
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jmasselink
jmasselink / .block
Last active May 31, 2018 00:07
gonarezhou
license: mit
@jmasselink
jmasselink / .block
Last active May 23, 2018 19:36
fresh block
license: mit