Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Granular FlyIn | |
* | |
* Built using Daniel Shiffman's "Explode" sketch as a base. | |
* | |
* Animates breaking apart of image, converging on z=0 plane. | |
* Maps pixels from a 2D image into 3D space. | |
* Saves exported frames as a numbered series of TIF files. | |
* Haven't actually looked at this since 2014 so this is | |
* probably extremely suboptimal. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String imgPath = "upthenose_color.jpg"; | |
String imgOut = appendSuffix(imgPath, "out"); | |
float imgScale = 0.5; // Scale for the image | |
int lineStep = 4; // Step for the y-axis | |
color backgroundColor = color(153, 0, 0); // Background color (R, G, B) | |
PImage img; | |
void settings() { | |
img = loadImage(imgPath); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Add a line to a map using a GeoJSON source</title> | |
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no"> | |
<link href="https://api.mapbox.com/mapbox-gl-js/v3.2.0/mapbox-gl.css" rel="stylesheet"> | |
<script src="https://api.mapbox.com/mapbox-gl-js/v3.2.0/mapbox-gl.js"></script> | |
<style> | |
body { margin: 0; padding: 0; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df <- sf::st_read("M274_parcels_CY22_FY23_sde.gdb", layer = "M274Assess") |> | |
dplyr::mutate( | |
simp = dplyr::case_when( | |
stringr::str_detect(USE_CODE, "^0?101") ~ "101", | |
stringr::str_detect(USE_CODE, "^0?104") ~ "104", | |
stringr::str_detect(USE_CODE, "^0?105") ~ "105", | |
stringr::str_detect(USE_CODE, "^0?109") ~ "109", | |
stringr::str_detect(USE_CODE, "^0?111") ~ "111", | |
stringr::str_detect(USE_CODE, "^0?112") ~ "112", | |
), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidycensus) | |
library(dplyr) | |
library(tidyr) | |
library(gt) | |
# vars <- tidycensus::pums_variables %>% | |
# dplyr::filter(year == 2017, survey == "acs5") | |
# | |
# vars_housing <- vars %>% | |
# dplyr::filter(level == "housing") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import geopandas as gpd | |
import pandas as pd | |
import contextily as ctx | |
from rasterio import open as rioopen | |
from rasterio import band | |
from rasterio.mask import mask | |
from rasterio.plot import reshape_as_image, show | |
from rasterio.transform import Affine | |
from rasterio.warp import calculate_default_transform, reproject, Resampling | |
import rioxarray |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
output: | |
pdf_document: default | |
--- | |
# Spatial Multilevel Modeling of Life Expectancy | |
```{r message=FALSE, warning=FALSE, echo=FALSE} | |
require('tidycensus') | |
require('readstata13') | |
require('stringr') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('tidyverse') | |
require('tidycensus') | |
library('jsonlite') | |
require('sf') | |
census_api_key("<yourapikey>") | |
stops <- fromJSON("https://api-v3.mbta.com/stops/?filter[route]=Red", simplifyVector = TRUE)[[1]]$attributes %>% | |
st_as_sf(coords = c('longitude', 'latitude')) %>% | |
st_set_crs(4326) %>% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from qgis import * | |
import processing | |
proj_path = QgsProject.instance().readPath("./") | |
layers = iface.mapCanvas().layers() | |
for n, i in enumerate(layers): | |
ext = i.extent() | |
size = 5280 |
NewerOlder