Last active
July 18, 2024 22:52
-
-
Save g4brielvs/d7f1a7dfcd4dadaf9fe806df78331fe2 to your computer and use it in GitHub Desktop.
BlackMarbleR Example
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(blackmarbler) | |
library(geodata) | |
library(sf) | |
# Set NASA EarthData Token | |
bearer <- "NASA-EARTHDATA-TOKEN" | |
# Retrieve GADM polygon of Lebanon | |
roi <- gadm(country = "LBN", | |
level=1, | |
path = tempdir()) |> | |
st_as_sf() | |
# Create NTL raster | |
ntl_r <- bm_raster(roi_sf = roi, | |
product_id = "VNP46A4", | |
date = 2019:2022, | |
bearer = bearer) | |
# Create NTL dataset from 2012 to 2022 | |
ntl_df <- bm_extract(roi_sf = roi, | |
product_id = "VNP46A4", | |
date = 2012:2022, | |
bearer = bearer, | |
aggregation_fun = "sum") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment