Git Product home page Git Product logo

cherry-blossoms-analysis's Introduction

Cherry blossoms data

This repo contains the data and map tile processing used in hrecht/cherry-blossoms for https://www.hrecht.com/cherry-blossoms/.

Data sources

  • 2024 cherry blossom tree dataset from Casey Trees

  • Metro lines and Metro stations from Open Data DC. I made updates based on the latest rail map from WMATA.

    • Note: These files had some incorrect and outdated information as of analysis time, mostly related to the Yellow Line changes in 2023. I emailed the Open Data DC team to flag this information and they were actively working on updating the files as of mid-March 2024.

    • I manually edited the yellow line route in QGIS to end at Mt Vernon Square (since updated in the Open Data DC file.)

    • I entered station rail line changes and station name splits into data/metro/metro-stations-corrections.csv and incorporated them with scripts/01-get-wmata-geo.R. Specifically, I updated the station rail line information and split out the long station names into name_short and name_subtitle for display purposes. For example, the U Street/African-Amer Civil War Memorial/Cardozo station has name_short: U Street and name_subtitle: African-Amer Civil War Memorial/Cardozo. The original file from DC still listed the green and yellow lines as serving this station, but it is now green line only.

  • State and water boundaries from Census TIGER/Line

Requirements

R for data analysis. Key packages used include some of the tidyverse for cleaning, sf for spatial analysis, and ggplot2 for mapping.

Building map tiles

Tiles for the interactive basemap are downloaded and built in scripts/00-make-basemap.sh. Install dependencies with homebrew:

brew install wget

Planetiler to build map tiles. Install Java 21+, necessary to run planetiler.

brew install --cask temurin

Save planetiler into the tiles subfolder (gitignored).

wget https://github.com/onthegomap/planetiler/releases/latest/download/planetiler.jar

Install tippecanoe for mbtiles merging.

brew install tippecanoe

Install pmtiles for clipping tiles to bounding box and converting into pmtiles format for the interactive map.

brew install pmtiles

cherry-blossoms-analysis's People

Contributors

hrecht avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

cherry-blossoms-analysis's Issues

{arcgislayers} in case you want to use arcgis hub data in the future :)

This analysis was super cool! I noticed you hand crafted and processed Feature Layer queries :)

In case you want to use data like this in the future you can make it a little bit easier by using the arcgislayers package!

library(arcgis)
#> Attaching core arcgis packages:
#> → arcgisutils v0.2.0.9000
#> → arcgislayers v0.2.0

# create a reference to the feature layer
cherry_blossoms <- arc_open(
  "https://services2.arcgis.com/j23KFYd23hRWewtZ/arcgis/rest/services/CHERRY_BLOSSOM_DATA_FINAL/FeatureServer/0"
)

# read all features as sf in parallel
all_trees <- arc_select(cherry_blossoms)

# preview
head(all_trees)
#> Simple feature collection with 6 features and 6 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: -8577336 ymin: 4704984 xmax: -8572557 ymax: 4709696
#> Projected CRS: WGS 84 / Pseudo-Mercator
#>   FID                      SciName         CmmnName Species  Genus Cultivar
#> 1   1               Prunus species      Cherry Spp.  <Null> Prunus         
#> 2   2             Prunus yedoensis   Yoshino Cherry  <Null> Prunus         
#> 3   3 Prunus serrulata 'Snowgoose' Snowgoose Cherry  <Null> Prunus         
#> 4   4             Prunus yedoensis   Yoshino Cherry  <Null> Prunus         
#> 5   5               Prunus species      Cherry Spp.  <Null> Prunus         
#> 6   6               Prunus species      Cherry Spp.  <Null> Prunus         
#>                   geometry
#> 1 POINT (-8572557 4704984)
#> 2 POINT (-8572657 4705214)
#> 3 POINT (-8572620 4705181)
#> 4 POINT (-8572618 4705115)
#> 5 POINT (-8576760 4708402)
#> 6 POINT (-8577336 4709696)

Created on 2024-03-20 with reprex v2.0.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.