-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using get_chirps over a SFC, possible? #37
Comments
For clarity, this is the set up: ETHIOPIA <- paste0(sourcepath, "/EthiopiaSHAPE") ETHIOPIAREP <- paste0(datapath, "/IN_PROGRESS/ETHIOPIA/ETHIOPIAREP.shp") ETHIOPIAREPP <- paste0(datapath, "/IN_PROGRESS/ETHIOPIA") OGP <- "+proj=longlat +datum=WGS84 +no_defs" |
Hello dear team, hello @MariusHees .... I am facing similar issue (how to retrieve data using get_chirps with a polygon as object input). Is there any update on this issue? @MariusHees, did you managed to work with your district polygons somehow? Thank you! |
Hi @samyadelara and @MariusHees sorry I missed this issue, but this is something that I asked to the ClimateSERV team with @billyz313 in this issue SERVIR/ClimateSERV#3 @billyz313 do you know if this is already available? I tried to find at the API document but I didn't. As an alternative option we could request the data from the other server CHC as COG files and handle it internally using terra and return either a raster or a sfc polygon. This might be a bit slow but good enough for reproducible analysis and workflows. What do you think @adamhsparks ? |
I worked in an alternative solution using CHC server. Remember that it may take a while to fetch the data if you request for many years data. If you install chirps v0.1.4.001 from Github using devtools you will be able to run this example.
Is this useful for you? |
@kauedesousa, I agree handling it internally with terra / sf with just regular rectangular data would be a fine compromise for reproducibility. |
Dear @kauedesousa and @adamhsparks , thank you so much for your prompt feedback on this and suggestions. Indeed, working with the bbox, extented using terra, worked perfectly for me here. Cheers all! |
extnt <- as(extent(c(xmin= 31, xmax= 49, ymin= 2, ymax= 20)), 'SpatialPolygons') this worked well for me to extract data for the given extent. However, I could not able to extract sample points from the domain. I hope you found a way to solve this as well. All the best, Markos |
Hello everyone and thank you very much for all of your amazing work,
I am trying to pull the chirps data for Ethiopia and I am struggling to advance.
This is my first time using CHIRPS, but I am really interested in working myself into the subject. My goal is to get CHIRPS data for ETHIOPIA, I will want to finally de-trend the precipitation averages (either daily or monthly) in order to find abnormalities, in order to identify regional droughts as the basis for me research. Hence, I would ideally have both the precipitation on a pixel by pixel basis and will also be able to connect the pixel to the respective districts.
I am using: https://geodata.lib.berkeley.edu/catalog/stanford-kz352sx7513 : as base input of Ethiopian districts over which I want get the chirps data.
#Problem
I am reading in the ETHIPIA District Shapefile above as a SFC_Multipolygon, with the intention of pulling the CHIRPS data for each district over a given period of time. Am I correct in the assumption that the "get_chirps" command is currently only able to pull data for geographic points or is it somehow able to pull the CHIRPS data for entire districts?
I have been trying around a lot but can't figure which approach would work, if you guys have any insights or inputs I would be incredibly grateful. Even if the answer is an affirmation that what I want to do is not possible with the get_chirps command. (Would have to manually load in all the CHIRPS data images.)
The code (ETHIOPIA = The data input):
ETHIOPIA_shp <- st_read(ETHIOPIA)
ETHIOPIAREP_shp <-st_transform(ETHIOPIA_shp, CRS(OGP))
st_write(
ETHIOPIAREP_shp,
ETHIOPIAREP,
format="GTiff", append=FALSE)
SPDF <- readOGR(dsn=ETHIOPIAREPP,layer="ETHIOPIAREP")
dates <- c("2017-12-15", "2017-12-31")
get_chirps(SPDF, dates, operation = 5)
yields the error :
Fehler in
[.data.frame
(lonlat, , 2) : undefined columns selectedand if I use:
get_chirps(ETHIOPIAREP_shp, dates, operation = 5)
in the last line, it runs forever without end. This is where I think it might not be possible to run it for multipolygons.
I hope this question / issue is not to far away from the intended use of get_chirps and that I am not wasting your time.
Thank you in advance for any help or input!
All the best,
Marius
data(1).zip
The text was updated successfully, but these errors were encountered: