Skip to content

Instantly share code, notes, and snippets.

@darrenwiens
darrenwiens / travel_bbox.geojson
Created August 25, 2021 15:56
West: Kauai 🇺🇸, South: Hawai'i 🇺🇸, East: Bucharest 🇷🇴, North: Tromso 🇳🇴
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@darrenwiens
darrenwiens / STAC Leafmap time series
Last active January 29, 2023 11:17
Make a Leafmap time series animation from STAC query results
import ipyleaflet
import json
import leafmap
import requests
stac_api = "https://earth-search.aws.element84.com/v0"
search_endpoint = f"{stac_api}/search"
collection = "sentinel-s2-l2a-cogs"
payload = {
@darrenwiens
darrenwiens / index.html
Created March 3, 2022 00:35
FMV Example, Mapbox
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>FMV Demo</title>
<meta
name="viewport"
content="initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<link
@darrenwiens
darrenwiens / index.html
Last active March 13, 2022 00:08
Gourdle web app
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Gourdle</title>
<meta
name="viewport"
content="initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<style>
@darrenwiens
darrenwiens / index.html
Created March 13, 2022 22:10
GLTF playground, Mapbox
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>glTF Playground</title>
<meta
name="viewport"
content="initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<script src="https://api.mapbox.com/mapbox-gl-js/v2.3.0/mapbox-gl.js"></script>
@darrenwiens
darrenwiens / main.py
Created March 14, 2022 22:54
Climate spiral, Blender
import bpy
import math
import pandas as pd
df = pd.read_csv(
bpy.path.abspath("//HadCRUT.4.6.0.0.monthly_ns_avg.txt"),
delim_whitespace=True,
header=None
)
@darrenwiens
darrenwiens / bc_topo_rayshader.ipynb
Created March 18, 2022 02:59
Jupyter notebook, demonstrating how to create a rayshader animation for BC Topo data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@darrenwiens
darrenwiens / main.py
Created March 19, 2022 00:28
STAC assets in Blender
import bpy
import datetime
import json
import numpy as np
import requests
import rasterio
from PIL import Image
from pyproj import CRS, Transformer
url = "https://earth-search.aws.element84.com/v0/search"
@darrenwiens
darrenwiens / country_area.ipynb
Created March 21, 2022 01:14
Jupyter notebook to add area to calculate country geojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@darrenwiens
darrenwiens / main.py
Created March 21, 2022 01:33
Blender script for animating countries by area
import bpy
import json
from shapely.geometry import shape
with open("/path/to/sorted_countries.geojson", "r") as f:
fc = json.load(f)
buffer = 0.1
cur_zero = 0
total_frames = 1400