Accessing satellite data
This is the basic NEXRAD file
athens <- leaflet() %>%
addProviderTiles(providers$OpenStreetMap) %>%
setView(lat=33.947474, lng=-83.373671, zoom = 6)
athens %>% addWMSTiles(
"http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi",
layers = "nexrad-n0r-900913",
options = WMSTileOptions(format = "image/png", transparent = TRUE),
attribution = "Weather data © 2020 IEM Nexrad"
)But there are many more:
From the OGC (Open Geodata Consortium) Here, mesonet’s list
Note how cgi files have different layers
For instance, https://mesonet.agron.iastate.edu/cgi-bin/wms/us/mrms_nn.cgi? has 4 layers: Layer: mrms_p72h 72 Hour Precipitation Layer: mrms_p48h 48 Hour Precipitation Layer: mrms_p24h 24 Hour Precipitation Layer: mrms_p1h One Hour Precipitation
- If you try this code, it will not work:
athens <- leaflet() %>%
addProviderTiles(providers$OpenStreetMap) %>%
setView(lat=33.947474, lng=-83.373671, zoom = 4)
athens %>% addWMSTiles(
"https://mesonet.agron.iastate.edu/cgi-bin/wms/us/mrms_nn.cgi?",
layers = "nexrad-n0q-900913", # You're calling the wrong layer
options = WMSTileOptions(format = "image/png", transparent = TRUE),
attribution = "Weather data © 2020 IEM MRMS"
)- However, if you call the correct layer, it appears correctly:
72 Hour Precipitation
athens <- leaflet() %>%
addProviderTiles(providers$OpenStreetMap) %>%
setView(lat=33.947474, lng=-83.373671, zoom = 4)
athens %>% addWMSTiles(
"https://mesonet.agron.iastate.edu/cgi-bin/wms/us/mrms_nn.cgi?",
layers = "mrms_p72h",
options = WMSTileOptions(format = "image/png", transparent = TRUE),
attribution = "Weather data © 2020 IEM MRMS"
)One Hour Precipitation
athens <- leaflet() %>%
addProviderTiles(providers$OpenStreetMap) %>%
setView(lat=33.947474, lng=-83.373671, zoom = 4)
athens %>% addWMSTiles(
"https://mesonet.agron.iastate.edu/cgi-bin/wms/us/mrms_nn.cgi?",
layers = "mrms_p1h",
options = WMSTileOptions(format = "image/png", transparent = TRUE),
attribution = "Weather data © 2020 IEM MRMS"
)Note how your code is retrieving different images/layers from the online database as needed. These files are updated regularly on the server, thus your webpage will also load different images over time.