Skip to content

Instantly share code, notes, and snippets.

View eamcvey's full-sized avatar

Elaine eamcvey

View GitHub Profile
# Day 25: Hexagons - US Wind Energy Infrastructure
# Multi-resolution H3 hexagonal aggregation of 76,000+ wind turbines
# Aggregating total installed capacity (MW) per hexagon
# Points fade in at high zoom for individual turbine exploration
library(mapgl)
library(h3o)
library(sf)
library(dplyr)
library(readr)
# Day 26: Transport - US Electric Power Transmission Lines
# Visualizing America's invisible highway: 700,000+ miles of power lines
# Dynamic line widths by voltage class, glowing effect for the energy flow
library(mapgl)
library(sf)
library(dplyr)
# Load transmission lines from HIFLD (Homeland Infrastructure Foundation-Level Data)
# This is a large dataset - we'll use direct URL for the GeoJSON
# Day 27: Boundaries - World Time Zones
# Shows current time in each timezone
library(mapgl)
library(sf)
library(dplyr)
library(lubridate)
# Get user's current timezone and time
user_tz <- Sys.timezone()
# DuckDB Vector Tiles with mapgl Example
# This script demonstrates how to serve vector tiles from DuckDB using ST_AsMVT()
# and display them in a mapgl map using httpuv
library(mapgl)
library(duckdb) # Requires the latest DuckDB version (>= 1.4.0)
library(httpuv)
library(sf)
library(duckspatial)
library(tigris)
@eamcvey
eamcvey / gist:540191bda4f6fa4f09db44492d04975c
Created November 19, 2020 01:20
reprex_string_parsing_speed
``` r
# Setup -------------------------------------------------------------------
library(tidyverse)
library(reprex)
library(tictoc)
#> Warning: package 'tictoc' was built under R version 4.0.2
@eamcvey
eamcvey / rayshade_gpx
Created July 2, 2020 22:25
How to make a 3-D map with GPX and USGS data in R using rayshader
# Setup -------------------------------------------------------------------
library(tidyverse)
library(sf)
library(elevatr)
library(rgdal)
library(raster)
library(rasterVis)
library(rayshader)