-
Notifications
You must be signed in to change notification settings - Fork 50
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 predict.gstat function with nsim>0 causes segfault error #141
Comments
Hi, I've analysed the problem more in depth and it seems to stem from a projection error. The points in val_sp are projected too far away from the points used to fit the variogram and it may cause a memory overload ? This is my hypothesis here. Fyi, here is a dataset for which the 300 simulations can be carried out: https://filesender.renater.fr/?s=download&token=c23e2359-6334-42ae-b425-2127bd302b63 This dataset has the same CRS and coordinates of similar magnitude to val_sp's, but it does not look like their extents overlap. Weirdly, when I plot grd and then val_sp, they look like they are in the exact same projection. I've dealt with many CRSs issues before but I cannot figure this one out. I've reprojected the datasets over and over to make sure the CRSs match, but without success. Could you just help me make sure that val_sp and grd align? This will certainly solve the issue. Thank you very much for your help! And again, I remain available if you have any question |
Thanks for the update; I've looked at the issue and can reproduce the error you're getting. I can see where it happens when run in a debugger, but haven't been able to identify its cause. |
Thank you very much for looking into this problem!
This is very weird... |
This might be a clue:
|
works! |
Sorry for my late reply. It works, thank you so much for your time and effort ! |
Thanks; note that this is a work-around, the bug is still present. |
Yes, I've noticed: for now I just removed tens of points from my dataset (larger than the one I sent to you). I would be curious to understand what happens. |
Hi,
I've been encountering a problem I don't understand with the predict.gstat function.
I would like to use it to interpolate residuals using a cokriging model. Running the function with nsim=0 works fine but if I increase it to a larger number (even a small one like 10, although I need to run it eventually with nsim=300) it automatically causes the following error, even on computers with large computing power and memory:
*** caught segfault *** address 0x38, cause 'memory not mapped'
Could you help me identify the issue ?
I checked for duplicate coordinates with zerodist, for unmatching CRSs, I tried with many values of maxdist and nmax, as well as with fewer points, so I'm at a loss here.
Below is a minimal example, and here is the link to download data: https://filesender.renater.fr/?s=download&token=911d7d4c-6bf5-4bec-a316-8adc5417b9d8
Thank you very much in advance.
I remain available for any complementary information.
library(gstat)
# Load variogram
load("./var_awc.RData")
awc_sem <- cv.fit
# Load data to predict
val_sp <- readRDS("./point_data.Rdata")
# Works fine
gstat:::predict.gstat(awc_sem, newdata = val_sp)
# Crashes
gstat:::predict.gstat(awc_sem, newdata = val_sp, nsim=10, maxdist=500)
The text was updated successfully, but these errors were encountered: