Skip to main content
5 votes

QGIS sample raster via field calculator

This can be achieved via the field calculator and the following expression: raster_value( 'choose_raster_layer_from_map_layers', 1, $geometry) This appends a column (output field name) with the ...
Honeybear's user avatar
  • 2,554
3 votes

Adding column in attribute table with values sampled from raster using QGIS

Use the "Sample Raster Values" QGIS Processing Algorithm. The help for the tool states: Sample raster values This algorithm creates a new vector layer with the same attributes of the ...
Saijin_Naib - No To OpenAI's user avatar
3 votes
Accepted

How can ee.Image.stratifiedSample() be used in Google Earth Engine to select training samples for a binary classifier?

You're not doing anything wrong, it's just that S2 images have a lot of bands and taking the median() of them generates double valued pixels, so the tiles being passed back and forth between servers ...
Noel Gorelick's user avatar
2 votes
Accepted

Distance based random point selection in r?

Well, if it was as simple as an out-of-the-box sample function with a distance argument, I would have provided that as a solution (although now, I may write one). Depending on your sample, you can ...
Jeffrey Evans's user avatar
2 votes
Accepted

Randomly sampling polygons from polygon grid using the spatialEco package in R

I cannot replicate this error so, I imagine, as the error indicates, you are actually running out of memory. Besides reading in the grid, with 229,374 polygons you are trying to create 68,812,200 ...
Jeffrey Evans's user avatar
2 votes
Accepted

Combining imagery, masking and sampling in Descartes Labs Platform

To run at scale, rather than calling .compute in a for-loop over each tile, you can submit all the tiles to the backend at once to run in parallel as Workflows Jobs, then asynchronously process them ...
caitlin kontgis's user avatar
2 votes

Randomly sample points within polygons

You can achieve this using a virtual layer. Go to the menu Layer > Add Layer > Add/Edit Virtual Layer... and enter the following query. Feel free to add/remove any field of interest from the two ...
JGH's user avatar
  • 43.3k
1 vote

Multidimensional Sample Tool not working on ModelBuilder of ArcGIS Pro

I too can replicate the issue in Modelbuilder. The help files states for the raster layer parameter: The process_as_multidimensional parameter is only supported when the input is a single, ...
Hornbydd's user avatar
  • 44.6k
1 vote
Accepted

gee ranadomPoints fails:Polygon too large to be randomly sampled. Must be smaller than a hemisphere when image is not so huge

I would guess this is a performance optimization. It doesn't actually set the footprint of the image when clipping to a feature collection. The geometry might be very complex and memory intensive to ...
Daniel Wiell's user avatar
  • 14.8k
1 vote

Sample points randomly on an image using Google Earth Engine

You were close; you want a combination of the two. Use a mapped stratifiedSample on the biome's mask band. var points1 = grid.map(function(feature){ return biome.mask().gt(0).selfMask()....
Noel Gorelick's user avatar
1 vote

Created weighted sample points in ArcGIS Pro

Here is an untested idea from the top of my head for you to explore. Try using the Focal Statistics tool using the variety statistic type; you would need to explore with different neighbourhood sizes. ...
Hornbydd's user avatar
  • 44.6k
1 vote
Accepted

How to find if a non-random subsample of a raster is significantly different from the raster using ArcGIS 10.7

This is a bit of a tricky question. There is a simple answer and a correct one. Which path you choose should be dictated by your motivation and need. If this is just meant to be a gut check you can ...
Jeffrey Evans's user avatar
1 vote
Accepted

Implementing proportional stratified random sample in R

?sampleStratified says: size: positive integer giving the number of items to choose not a vector of integers. You could do what you want by sampling over each category. This might not be very ...
Spacedman's user avatar
  • 66.5k
1 vote

Sampling list of rasters in ArcPy?

As commented by @BERA: When you do for r in rasters, r will be a single raster. If Sample wants a list of rasters and you are inputing one raster (r) it will not work.
PolyGeo's user avatar
  • 65.4k
1 vote

Random sampling of many millions of Points or raster cells with ArcGIS Desktop?

You could use the Create Random Points tool. Set the Constraining Feature Class to be your points feature class. The tool will then generate the specified number of points on top of random points ...
Dan_h_b's user avatar
  • 2,118
1 vote

Sample values from a grid by points in RQGIS

If you have a look at the source code of pick.from.saga.grid, you will realize that it is an independent R function. That means the function does not use SAGA in the background but instead uses an ...
Jannes's user avatar
  • 672

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