rmbl-sdp / rsdp Goto Github PK
View Code? Open in Web Editor NEWR Interface for Spatial Data in the RMBL Spatial Data Platform
Home Page: https://rmbl-sdp.github.io/rSDP
License: Creative Commons Attribution 4.0 International
R Interface for Spatial Data in the RMBL Spatial Data Platform
Home Page: https://rmbl-sdp.github.io/rSDP
License: Creative Commons Attribution 4.0 International
## bring in landcover raster
lc <- sdp_get_raster(catalog_id="R3D018")
## bring in 8 polygons as sf
field_planning = st_read("C:/Users/AmandaHenderson/SynologyDrive/UER_vegmap/output/sampling_areas_draft.gpkg")
## extract landcover data for polygons of interest
fp_lc = sdp_extract_data(raster = lc, locations = field_planning)
#[1] "Re-projecting locations to coordinate system of the raster."
#[1] "Extracting data at 8 locations for 1 raster layers."
#Error: [cbind] nrow does not match
Notes:
Same error when locations is SpatVector
sdp_extract_data(raster = lc, locations = field_planning, bind = FALSE) works, but returns a dataframe, which is less useful
Right now it's not possible to run the extraction function (sdp_extract_data()
) inside an expression parallelized via foreach()
.
location_df <- data.frame(SiteName=c("Roaring Judy","Gothic","Galena Lake"),
Lat=c(38.716995,38.958446,39.021644),
Lon=c(-106.853186,-106.988934,-107.072569))
location_sv <- terra::vect(location_df,geom=c("Lon","Lat"),crs="EPSG:4327")
days <- seq(as.Date("2007-10-01"),as.Date("2007-10-31"),by="day")
cl <- parallel::makeCluster(2L)
doParallel::registerDoParallel(cl)
extr_list4 <- foreach::foreach(i=1:length(days),.packages=c("terra","devtools","rSDP")) %dopar% {
#devtools::load_all() ## During package development.
tmax4 <- rSDP::sdp_get_raster("R4D004",date_start=days[i],date_end=days[i],verbose=FALSE)
extr_dat <- rSDP::sdp_extract_data(tmax4,locations_proj,verbose=FALSE)[,3]
(extr_dat)
}
parallel::stopCluster(cl)
This gives an error:
: NULL value as symbol address.
I think it's related to this issue affecting functions in terra
more generally.
I ran the code in the README and caught a few reproducibility errors. They are all minor, so collecting here under a single issue.
Line 70 in d16a32b
Error in leaflet::addRasterImage(map, x, colors = col, opacity = alpha, : inherits(x, "RasterLayer") is not TRUE
Are raster data types supported when using tiles? Maybe this is a simple fix with class conversion?
2. Download argument misnamed
Lines 78 to 81 in d16a32b
download_data
should be changed to download_files
Lines 297 to 301 in d16a32b
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.