Skip to main content
17 votes
Accepted

R gstat krige() - Covariance matrix singular at location [5.88,47.4,0]: skipping

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. ...
Jeffrey Evans's user avatar
10 votes
Accepted

Performing Kriging in QGIS

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 ...
Jochen Schwarze's user avatar
10 votes

Which interpolation technique is suitable for a bathymetry of a small lake?

One alternative is spline interpolation as suggested in the related post: Interpolation of multibeam bathymetry. From QGIS, use the GRASS tool v.surf.rst: Performs surface interpolation from ...
Andre Silva's user avatar
  • 10.3k
10 votes
Accepted

Replica of point layer data from attribute value in QGIS

The following script does the job: layer = QgsProject.instance().mapLayersByName('Layer_Name')[0] name_field = 'Name' # not mandatory count_field = 'Count' # numerical field, mandatory # make new ...
Kadir Şahbaz's user avatar
9 votes
Accepted

Interpolate smoothly nodata values in QGIS

I got curious and tried the different fill nodata functions. As you can see the regular SAGA Close Gaps produced the least anomalies. It also took the longest.
Baswein's user avatar
  • 2,326
8 votes

Performing Spline interpolation on GPS Track

Try using v.generalize tool from the Processing Toolbox. There are a number of algorithms in there that can generalize a line nicely. Another possible solution could be the "Generalizer" ...
Andrew Jeffrey's user avatar
8 votes

Downscaling raster images in Google Earth Engine?

You can control the pixel size of an image by setting the scale parameter of ee.Image.reproject(): // Reference a Landsat scene. var image_30m = ee.Image('LANDSAT/LC08/C01/T1/LC08_044034_20170614'); ...
Tyler Erickson's user avatar
8 votes
Accepted

How to use GDALGridInverseDistanceToAPower in a python script

Yes, you can call this from a Python script. But you don't directly call the low-level C API. First, take a look at the GDAL Grid Tutorial for background info. From the Python library, the relevant ...
Mike T's user avatar
  • 42.2k
8 votes

PostGIS: Interpolate/Cluster geographic points to average points

A solution using PostGIS alone. The Steps are as follows: Generate clusters from the points Get the centre of each point cluster Generate a line that connects each cluster centre point (will also ...
Cushen's user avatar
  • 3,167
8 votes
Accepted

Interpolating series of points between two locations using Python

A simple linear interpolation solution This solution generates N-number of random points lying on a straight line between two initial locations. Initial latitude and longitude were transformed to x ...
Taras's user avatar
  • 33.3k
7 votes
Accepted

Interpolating degree data using QGIS?

Interpolate the sine and cosine of the angle, and then convert back to an angle with the atan function. These functions are available in QGIS' expression engine. There is an atan2(dy,dx) function like ...
Spacedman's user avatar
  • 65.1k
7 votes
Accepted

How to calculate kriging weights?

Is it true that we're just using a different set of weight values than the 1/distance in IDW? Yes, both IDW interpolation and Ordinary Kriging (OK) will calculate weights based on distance, but with ...
Andre Silva's user avatar
  • 10.3k
7 votes
Accepted

Smoothing/interpolating across images in an ImageCollection to remove missing data

You can replace the values using where(). // Replace masked pixels by the mean of the previous and next months // (otherwise, how to deal with the first images??) var replacedVals = composites.map(...
Kuik's user avatar
  • 10.1k
7 votes
Accepted

Interpolation on grid using QGIS

The solution: the principles You can do this creating an interpolated raster out of the points and then get the raster (pixel) value inside of each cell. There are several raster interpolation methods ...
Babel's user avatar
  • 73.1k
7 votes

Using gdal to interpolate elevation from a GeoTIFF

A high-level rasterstats tool is built on GDAL to fetch data from raster and vector data sources. import rasterstats from shapely.geometry import Point raster = "elevation.tif" pt = Point(...
Mike T's user avatar
  • 42.2k
6 votes

Weird output when projecting/interpolating points on lines

I think you have a problem with your points shapefile and/or the projections (lines and points). These commands are those of Shapely used by GeoPandas From Coordinate of the closest point on a line ...
gene's user avatar
  • 55.1k
6 votes

TIN Interpolation plugin in QGIS 3.0

According to the changelog, the TIN interpolation plugin has been removed, as it is now part or QGIS core. To find it in Qgis 3.0, open the processing toolbox and search for Interpolation -> TIN ...
Kantan's user avatar
  • 1,927
6 votes
Accepted

Adding points every X distance along a LineString

This is actually pretty easy. Have a look at https://shapely.readthedocs.io/en/stable/manual.html#object.interpolate Sample code: distance = 0 ## starting at length 0 add_distance = 10 ## eg ...
Jan Doležal's user avatar
6 votes
Accepted

Copying set of points perpendicular along polyline using PyQGIS

You're very close. Now, you just need to rotate your points in the inner for loop. To know how many degrees, get these 2 angles: # Before the for loops n_p_angle = river_geom.interpolateAngle(...
Germán Carrillo's user avatar
6 votes
Accepted

Interpolation with 10 data points

Both methods are "appropriate". IDW basically says "half way between a point valued 6 and a point valued 8 the value is going to be 7", but extended to the distance to multiple ...
Spacedman's user avatar
  • 65.1k
5 votes

What resampling technique should be used when projecting aerial photos?

The previous answers are correct when you truly wish to RESAMPLE your data, such as if you are aggregating your data from a 30 m pixel size to a 90m pixel size. In this case you are attempting to ...
Rachel M's user avatar
5 votes

How to compute an interpolation raster from the python console in QGIS?

The documentation on pyqgis is not very self-explanatory, but i figured out how to properly call the associated interpolation classes (QgsInterpolator, QgsTINInterpolator, QgsIDWInterpolator, ...
root676's user avatar
  • 2,385
5 votes
Accepted

Error in In predict.gstat in R

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 ...
Jeffrey Evans's user avatar
5 votes

Slope layer with false results in QGIS?

As mentioned in comments by user30184 and GerardoJimenez this is due to the horizontal coordinates x and y having a different unit of measurement from the elevation coordinate z. For example, having ...
Andre Silva's user avatar
  • 10.3k
5 votes

How to interpolate a lat/long point between two others at a given distance

The name of the curve you are looking to interpolate along is called either a great circle for a sphere, or a geodesic for an earth-shaped ellipsoid of revolution. Using GeographicLib, you can create ...
Mike T's user avatar
  • 42.2k
5 votes

Converting LiDAR ellipsoidal heights to orthometric heights?

PDAL can do this with its filters.reprojection capability, which is based on the vertical datum transformation capabilities of Proj.4. pdal translate input.las output.las reprojection --filters....
Howard Butler's user avatar
5 votes

How to calculate kriging weights?

Maybe I should begin by stating that "the summit issue is reflecting how IDW models the surface, rather than weighting". IDW sees the predicted surface as an averaging model, while Spline tries to ...
Kazuhito's user avatar
  • 31k
5 votes
Accepted

Interpolation (TIN) from Python Console in QGIS

The following minimal example is in a somewhat similar format to the post you linked to which should work for QGIS 3: # Interpolate points using QgsTinInterpolator pathToFile = "path/to/input.shp" ...
Joseph's user avatar
  • 76k
5 votes
Accepted

Reduce artifacts/errors in DEM

You need points in both sides of the road to interpolate. In the process we will get also a buffer to clip the raster. Create a buffer of your lines with a proper radius for a road (let's assume ...
Gabriel De Luca's user avatar
5 votes
Accepted

Using shapely interpolate to evenly re-sample points on a linestring geodataframe at specified interval

Why not use the function defined in Mike T's answer from the post you linked to? def redistribute_vertices(geom, distance): if geom.geom_type == 'LineString': num_vert = int(round(geom....
Nick's user avatar
  • 1,613

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