I had previously built a Leaflet map that pulled past precipitation data (24, 48, and 72 hours) from the NOAA nowCOAST site, however, the site was decommissioned. I used a previous StackExchange post to built the Leaflet map here: Adding weather radar data to leaflet from website
The goal of my map was to match the map shown at this website: https://www.iweathernet.com/total-rainfall-map-24-hours-to-72-hours which looks like this:
To reiterate, the leaflet map and the map at this website had matched previously. After the decommission of nowCOAST, I inspected the new data source for the site at it revealed that it is pulling data from a NOAA mapserver: https://mapservices.weather.noaa.gov/raster/rest/services/obs/rfc_qpe/MapServer
The problem arises when I try to use the same data pull to recreate the leaflet map. I used R, like so:
library(leaflet)
library(sf)
library(tidyverse)
library(rgdal)
tdir=tempdir()
stateurl = "https://www2.census.gov/geo/tiger/GENZ2018/shp/cb_2018_us_state_500k.zip"
if(file.exists(paste(tdir,"/cb_2018_us_state_500k.shp",sep=""))==F){
download.file(stateurl, destfile = file.path(tdir, "States.zip"))
unzip(file.path(tdir,"States.zip"),exdir=tdir)}
NYS = read_sf(paste(tdir,"/cb_2018_us_state_500k.shp",sep="")) %>%
filter(NAME=="New York") %>%
st_transform(.,crs=32618)
USA = read_sf(paste(tdir,"/cb_2018_us_state_500k.shp",sep="")) %>%
filter(!c(GEOID%in%c("72","02","60","78","15","69","66"))) %>%
st_union()
url = "https://mapservices.weather.noaa.gov/raster/services/obs/rfc_qpe/MapServer/WMSServer?"
leaflet() %>%
addTiles() %>%
addPolylines(data=USA,
color = "red",
stroke = TRUE,
weight=3,
group = "USA") %>%
addWMSTiles(url,
layers="25",
options = WMSTileOptions(format = "image/png",
transparent = TRUE,
opacity=.7),
group = "24-Hr Accumulation")
Created on 2024-05-24 with reprex v2.0.2
Clearly, the map created by pulling from the data source does not match the website.