Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Hot answers tagged

37

Both forms rely on Toblers first law of geography: things that are close are more related than things that are further apart. IDW is the simpler of the two techniques. It involves using known z values and weights determined as a function of distances between the unknown and known points. As such in IDW points that are far away have far less influence than ...


30

When you use "default values" you aren't really kriging, you're just applying the kriging algorithm--which as you have found, is poor when used with these data. (I will step up on a soapbox for a brief rant: in my opinion, the fastest way to get bad results with a computer program is to accept its default parameters. ArcGIS is one of the richest, most ...


14

This error is commonly returned because you have duplicate locations. You can check this using the sp::zerodist function. To remove duplicate locations you call sp::zerodist within a bracket index. WeatherData <- WeatherData[-zerodist(WeatherData)[,1],]


13

In order to interpolate prices with kriging you first need to convert your geographic coordinates to projected coordinates. Assuming you have them, below there is a reproducible example, showing a way to accomplish such task. library(sp) #Spatial data containing variables which can be interpolated. #We will use the zinc column; as an equivalent for 'price'....


12

You're right ... it is pretty easy! The "raster" package has some pretty straightforward ways of dealing with creating and manipulating rasters. library(maptools) library(raster) # Load your point shapefile (with IP values in an IP field): pts <- readShapePoints("pts.shp") # Create a raster, give it the same extent as the points # and define rows and ...


10

The great thing about QGIS is its modular design, based on which you can use the geoprocessing engines of various other systems directly as tools in QGIS (GRASS, SAGA, GDAL, OGR, ...). In order to do so, you need to activate the 'processing' extension. Then you can switch on the 'Geoprocessing Toolbox' via menu 'Processing' > 'Toolbox'. Searching for '...


8

In a nutshell, the problem lies in a mismatch between data behavior and some (strong) assumptions you are implicitly making. Diagnosis The strongest of these is that the data are one realization of a second-order stationary process. They clearly are not, as you can tell by comparing the region near (450000, 5075000) in the upper "neck" (which I will call "...


6

I would also suggest to consider the gstat package (either standalone or the R package), which -in my experience - is a bit between geoR and Geostatistical Analyst: you do not have the very advanced models of geoR but it's more efficient from a computing perspective (its core is in C). Also, you might be interested in the automap and intamap packages.


6

If you never have run kriging before, you should understand what you are doing. If this is not the case, get a textbook on geostatistics. Anyway, most parameters are there to determine the variogram: johan@cdh7:~$ saga_cmd libgeostatistics_kriging 5 _____________________________________________ ##### ## ##### ## ### ### ## ### ### # ...


6

Yes. The standard methods used to cross-validate and assess Kriging also apply, practically with no change, to almost any other method of interpolation. These include jackknifing, a form of leave-out-one cross-validation in which each data point is systematically removed from the dataset and predicted using the chosen variogram model. The discrepancy ...


6

Some has already been said by Spacedman in the comments. This warning may not pose a problem, if the variogram looks good. A good option might be to initialize some of the variogram parameters in vgm("Sph"). I usually take these values as default: vario <- variogram(Temperature ~1, WU_data_spatial) vario.fit <- fit.variogram(vario, vgm(psill=max(...


5

For reliable methods, I would do a literature review to find the best option given your time, resources and questions you are trying to accomplish. This one, so far, is popping out


5

In your case, where you have a multivariate problem, ordinary Kriging is quite inappropriate. I find your interpretation of this as an "interpolation" problem is a bit off base as well. This is an estimation problem and more suited for Machine Learning or spatial regression, not geostatistics. The grey area are Splines. This can be a univariate interpolation ...


5

In sp, SpatialPoints*, SpatialPixels* and SpatialGrid* (with * omitted or replaced by DataFrame) do support more than 2 spatial dimensions, as OP has done, but SpatialPolygons* and SpatialLines* do not. With gstat you can do 3-D block kriging with 3-D blocks (using block = c(10,10,10)), but you cannot do this for non-rectangular blocks, as OP wants. It is ...


5

SDA4PP appears to require an old version of R. R-2.11.0 worked for me for kriging. For Win: http://cran.r-project.org/bin/windows/base/old/2.11.0/ After installing R and SDA4PP, in QGIS go SDA4PP -> Components/R Packages and select the R packages that the plug-in needs. No guarantees I'm afraid. Nowadays I do my kriging with gvSIG/Sextante.


5

This is perfectly legitimate. It is based on the assumption that the covariance structure of the random field does not change from time to time. One way to see that this is OK (without writing complicated statistical formulas) is to suppose that the data at each time have the same relative locations--leaving the distances and bearings unchanged--but have ...


5

If you are just after a metric of performance, this is a fairly straight forward type of analysis to specify. 1) specify a model, 2) predict the model(s) at the data, 3) apply an accuracy/performance metric based on observed vs. predicted. We can step through the process thus (note; this is a dummy example so, ignore the REML errors): First lets specify ...


5

If you want to limit kriging to only interpolate within the polygons, you could adjust your Environment Settings. You can do this by selecting Geoprocessing - Environment Settings. Within there you should select Raster Analysis. This is where you can set the Mask for your workspace. Raster Analysis performed in your workspace will only be performed within ...


5

I don't know what kind of interpolation you're talking about but if average of all neighbours will be good value this could be the solution: create table hex_grid_data_av as ( select gid, wkb_geometry, value, case when value > 0 then value else (select sum(h2.value)/6 from hex_grid_data h2 where ST_Touches(h1.wkb_geometry, h2....


5

in theory, ordinary kriging is exact. However, if you interpolate on a grid, the probability that the center of the pixel (where the interpolated value is computed) falls exactly on an observed point is very very small. Therefore, the interpolated pixel value will not likely be the same as the points that are under it. This difference will be more apparent ...


5

I would write an R script that worked as a client, but will run on the database server. This will save the complication of trying to hook into PostGIS's backend and using PL/R (as I said in comments). The script will look something like this (which is practically pseudo-code here): > con = dbConnect(PG,"localhost","weather") # connect to local DB >...


5

Following a bit on what Jeffrey Evans said, you must remember that your data points define an area that's called convex hull. It is the (convex) polygon of minimum area that contains your data points. Values of locations inside that polygon can be estimated by interpolation (kriging, splines, IDW, etc). Outside that polygon you don't have interpolation, but ...


5

You are confusing terms and thus, confusing us. The expected input for kriging prediction in the gstat krige function is a systematic array of points and not polygons. It would also be nice if you provided a reproducible code example of what you have tried. You can use the extent of an sp object to create an array of points for the kriging prediction using ...


5

As I pointed out, you had identical observations. Additionally, you were not using the "resolution" argument in the raster function so, were only creating 100 pixel observations to predict to. I had to fix the tab returns in the file that you posted on dropbox, which was not appreciated. Here is code that I got to work. library(gstat) ...


5

You are correct about value you referred to, the residuals: An excerpt from Esri's Regression analysis basics Residuals: These are the unexplained portion of the dependent variable, represented in the regression equation as the random error term ε. View an illustration. Known values for the dependent variable are used to build and to calibrate the ...


5

After the study of https://rpubs.com/nabilabd/118172 and https://rpubs.com/nabilabd/134781 I assembled the following solution. library(sf) library(sp) library(gstat) library(tidyverse) Here are points I would like to play with. dt<-tibble::tribble( ~id, ~lon, ~lat, ~z, "a", 1.1, 1.3, 12.5, "b", 2.4, 1.7, 13.0, "c", 3.2, 1.4, ...


4

The kriging approach, appropriately implemented, is promising. As a point of departure, look at the "generalized linear geostatistical models" described by Diggle & Ribeiro in Model-based Geostatistics (Springer 2007). The underlying idea is appealing and flexible: a spatial stochastic process (which is spatially continuous) determines the various ...


4

gvSIG (another free GIS) does allow kriging, using Sextante. This is basically the same as using SAGA, but gvSIG provides a more 'typical' (i.e. ESRI-like) gis experience.


4

Either: generate a regular grid of points in the lat-long coordinate system, transform to ETRS89 using spTransform, and plug those points into whatever kriging package you are using (you don't say, you don't give examples), get the estimates, and back-transform with spTransform to lat-long. do your kriging in a regular grid in your ETRS89 system, then ...


4

If you leave the cell size blank you are telling ArcMap to choose its own, by your admission you've indicated that the data is dense so a small cell size would be suitable. e-006 means 6th decimal place (so 1e-006 is 0.000001). Is your source data in geographic coordinates (lat/lon)? this would explain the difference in cell dimensions i.e. stored in ...


Only top voted, non community-wiki answers of a minimum length are eligible