Questions tagged [spatial-interpolation]

Estimating new data points based on existing spatial observations

Spatial interpolation is a method of estimating new data points based on existing spatial interpolation. This tag focusses on spatial interpolation (data with a geographic component), although interpolation in a general also applies to e.g. timeseries.

Commonly, spatial interpolation involves using of the surrounding observations to estimate a new data point. This can be done using some kind of weighted mean (inverse distance weighted interpolation), by fitting a mathematical function through the existing points (splines), or a combination of both (kriging with external drift).

More information regarding which packages can be used to perform interpolation can be found on the Spatial Task View on CRAN, but in general the gstat, automap, Fields, and geoR packages are a good start for a wide range of spatial interpolation methods.

119 questions
0
votes
0 answers

Interpolation with tempdisagg package in R

I have a daily frequency data of stock prices with some missing values and I want to interpolate them using the package tempdisagg. Does anyone have an example of interpolation with this package? I am using this code: my_td \<- td(merged_df, High…
0
votes
0 answers

Wondering if my code is correct for Simple Kriging

I am a student and we learned about simple kriging with an example of 3 points with known elevations and 1 point with unknown elevation with the assumption that the empirical semivariogram is represented by the linear regression line with Y…
Frank D
  • 21
  • 1
0
votes
0 answers

I am trying to do an interpolation with IDW and I get TypeError: cannot convert the series to

idw.idw_interpolation( input_point_shapefile="C:/INFORMATICA APLICADA 22-23/Estaciones.shp", extent_shapefile="C:/INFORMATICA APLICADA 22-23/zonas_urbana_dmq.shp", column_name="SO2", power=2, search_radious=4, …
0
votes
1 answer

st_interpolate_aw returns error - replacement has x rows, data has y

I am working to re-aggregate population counts from one administrative level to another. One particular row keeps returning the error "replacement has 4 rows, data has 2". I have tried validating the geometries, but it has not worked. Neither did a…
0
votes
0 answers

2d interpolators of scipy for scattered data going crazy

I want to find the derivatives of some scattered data. I have tried two different methods: projecting the scattered data on a regular grid using scipy.interpolate.griddata, then computing the gradients with numpy.gradients, and then projecting…
0
votes
0 answers

is there any interpolation method in python which is similar to Empirical Bayesian Kriging?

EBK Regression Prediction is ESRI propriety tool for interpolation. But I am looking for some open source solution with same method Empirical Bayesian Kriging. I have 10 location rainfall data. I want to interpolate the data to fill the gap in…
0
votes
0 answers

How to resample a 2-D spatial matrix (not a time series) using a weighted average to from the 1km grid to the 0.25 degree

I have a bumpy matrix A with shape [num_X, num_Y]. The corresponding lattitude and longitude array is A_lat (of size [num_Y,1]) and A_lon (of size [num_X,1]). And the each element of this matrix for example A[i, j] represents a value of geophysical…
0
votes
1 answer

Aggregate interpolated data at county level with R

The raw data is at the state level and I would like to go down to the county level. To do this, I first adjusted the data to county level and then interpolated it. The raw data on state level looks like this: object name "df.sf" Simple feature…
0
votes
1 answer

Reduce artifacts when resampling a Brain MRI scan using scipy affine_transform

I have a Brain MRI. It is gray scale with 20 slices. I put it into a numpy array with shape (20,256,256). I use scipy.ndimage affine_transform to rotate and resample the array as below. The dark stipes in the image is the artifact that I want…
John Henckel
  • 10,274
  • 3
  • 79
  • 79
0
votes
1 answer

Is it possible to do interpolation over 4d data?

I am trying to implement this paper. I have to try to interpolate the latent code of an autoencoder, as mentioned in the paper. The latent code is the encoded input of an autoencoder. The shape of the latent code (for two samples) is (2, 64, 64,…
0
votes
1 answer

Filling Missing data in shapefile using spatial interpolation python

This is my first question. I am new to python so please bear with me. I have a shapefile that contains data as given below. ID Data geometry 111 0.1 POINT(X,Y) 112 0.2 POINT(X,Y) 113 0.5 POINT(X,Y) 114 NaN POINT(X,Y) 115 0.3 …
0
votes
0 answers

Problem loading mlr package in R due to memory limit

I am trying to reproduce the example of Spatial interpolation / prediction using Ensemble Machine Learning for which I need to use the "mlr" package I have installed it and everything is fine, but when trying to load it I have the following error: >…
dovat_
  • 1
  • 3
0
votes
1 answer

IDW(Inverse Distance Weighted) Interpolation in openlayers 6.4.3

I have a django3.1 web application with map using ol6 in which I want to show IDW. I have generated an idw image using python & added to map as an image layer but it does not overlay in accurate point positions. So I am looking for a method or…
0
votes
0 answers

What is a non rational function and how to choose its degree?

I am trying to approximate a surface from a set of given points in 3D space in sets like [[X1,Y1,Z1],[X2,Y2,Z2],.....] and I found this very nice library called geomdl this approximates the surface quite well. but I am not able to understand its…
0
votes
1 answer

Polygon boundary interpolation in R

I have a polygon dataframe: With vertice coordinates: 43740.95 40726.46 43741.36 40720.19 43742.67 40729.28 43743.99 40716.16 43745.52 40730.97 43748.72 40714.19 43748.72 40731.14 43748.72 40714.19 43752.23 …
DigiPath
  • 179
  • 2
  • 10