Questions tagged [extract-by-mask]

Isolating particular cells to a new raster based on overlap with another raster or vector layer, or specified values/ranges.

Filter by
Sorted by
Tagged with
1 vote
0 answers
15 views

Mask NetCDF file data with multiple variables from shapefile in Python

Most of the solutions to this I've seen online only work on 3-D time series data, but my NetCDF files has more than one variable. It has a data variable named Albedo and I need to plot it using a ...
user avatar
3 votes
3 answers
49 views

Extract multiple raster samples by input vector layer

I am working in QGIS 3.24.0. I am working on a project using the NLCD raster for the contiguous USA. I need to extract 208 circular buffers (10km radius) and have them each saved as a separate raster ...
user avatar
  • 31
1 vote
1 answer
64 views

Extract by polygon from a rioxarray's raster

I'm attempting to extract NBR mean value from MODIS data based on a set of polygons. The polygon set has overlapping everywhere (don't blame me, it's not my work nor my idea). The shapefile is ...
user avatar
  • 12.1k
0 votes
0 answers
36 views

GDALWARP masking first then reprojecting, want it to do vice versa. What defines order of operations in GDALWARP?

I need GDAL to reproject a raster to a new CRS and cell size (smaller than the original, don't ask why), then mask the raster to a polygon. Here is the command gdalwarp -overwrite -t_srs EPSG:26917 -...
user avatar
  • 1,395
1 vote
0 answers
28 views

different extent after extract by mask

I have two rasters and a study area vector, they are all WGS84 CRS. When I use the vector to mask those rasters, the results showed different extents and rows and columns. I tried 'extract by mask' in ...
user avatar
0 votes
1 answer
67 views

Using Identify in ArcGIS Pro

I am a fresh to GIS. In ArcMap 10.3 I can use the Identify tool to check the same pixel in time series, but in ArcGIS Pro when I load several rasters, it can only identify one layer. What can I do so ...
user avatar
1 vote
1 answer
100 views

increasing 'extent' of small raster to be same size as large raster in R [closed]

I have a satellite image with dimensions (11418, 13790, 1). The resolution is 10m. I have two other rasters, which fall inside of my satellite image which are the same resolution and crs. How would I ...
user avatar
1 vote
1 answer
38 views

Clip a vector without losing geometries - QGIS 3.22

I experienced a lot of issues trying to keep only a German region from the vector I have of Europe. I've tried everything, using mask+clip with my shapefile of the German region, using "Select by ...
user avatar
  • 399
1 vote
0 answers
16 views

Actual area from polygons is either under- or overestimated when extracting raster values - any solutions?

I am trying to use ModelBuilder to iterate through sets of polygons to overlay on top of two rasters and extract the total area of each value from each raster, but am having issues with the estimated ...
user avatar
  • 11
0 votes
1 answer
348 views

Mask raster with bounding box from a different CRS

My apologies if this question has been asked before; but I could not find my specific question answered elsewhere. I define a bounding box with bounds (xmin,xmax, ymin, ymax) in a rotated lon/lat ...
user avatar
  • 175
2 votes
1 answer
358 views

Cropping raster (rectangle) with shapefile (mask) in QGIS

My study area is in black, and in grey the shape of Portugal. I am creating my study area. It corresponds to the coastal area of Portugal. I have a shapefile for Portugal. I want to crop a raster that ...
user avatar
0 votes
0 answers
58 views

QGIS crashing when runing a loop to perfom select by location with PyQGIS

I have written a script to divide United States into a grid of 200 km, then in each grid will contain a certain number of mobile towers with (lat and long). The script must then select each grid and ...
user avatar
2 votes
1 answer
93 views

Splitting georeferenced image with grid features help

I have a large orthomosaic image with a fishnet grid overlaid on top. I am trying to cut the image into the grid sized pieces and follow their FID. So far the best way to do this I've found is using ...
user avatar
  • 35
0 votes
0 answers
13 views

Extract by mask-timeslider issue

I have an issue with the "extract by mask" tool. My Raster Layer is a layer with time content, so I can start an animation with the timeslider. If I extract it based on a country border ...
user avatar
0 votes
0 answers
69 views

Extracting pixel values from dispersed pixels across various countries

I am trying to calculate extreme events of rainfall using ERA-5 Daily Data in Google Earth Engine through Python. I am trying to find pixels that had more rain than the 95th percentile of the previous ...
user avatar
1 vote
2 answers
98 views

NoData values surrounding the masked raster (.tif) after using Extract by Mask (ArcMap)

I do have a NUTS-2 region shapefile as you can see below and a raster (.tif) file that represents the soil erosion (tonnes per hectare per year) derived from the RUSLE2015 model. What I want is to ...
user avatar
3 votes
1 answer
410 views

Batch process the clipping of multiple rasters by a corresponding polygon layer (different for each layer)?

I'm trying to clip ~300 rasters from a time series by vector masks to extract only reliable pixels - the vector polygons are different per raster. The file names are corresponding eg. ...
user avatar
  • 33
0 votes
1 answer
171 views

Geting slope in Google Earth Engine of defined sets of points?

I have an reclassify a slope in the, and I have points(ee_kaski) with lat,lng . I want to extract value of the reclassify slope value where this points lies on it. I have tried this using Python API. ...
user avatar
0 votes
1 answer
105 views

Errors generating an NDVI Timeseries for masked land cover classes using the Copernicus landcover 2019 Global product in Google Earth Engine

I have masked my landcover classes but I am unable to generate an ndvi time-series for these masked landcover classes. I am using the Copernicus 2019 land cover product and would like to start with ...
user avatar
  • 162
0 votes
1 answer
148 views

Multiple Selection and clip raster by mask in QGIS using PyQGIS

I am doing raster by mask on multiple polygons. Selection on the basis of "CONTCD='AFR'" is running fine. Second selection and looping to for mask is only showing all. layer=QgsVectorLayer(&...
user avatar
  • 3
0 votes
1 answer
287 views

Masking out Copernicus 2019 100m global land cover classes and for an NDVI time-series analysis in Google Earth Engine

I am quite new to Google Earth Engine and Java scripting. I am delineating land cover data for an administrative area in Kenya (Samburu county) from the Copernicus Global Landcover 100m product. I've ...
user avatar
  • 162
2 votes
0 answers
78 views

Why does raster still have pixels around edge when clipped?

I am trying to clip a raster in ArcMap 10.6 (derived from 'make nedcdf raster') to the shape of the Ireland polygon and I keep getting back pixels around the edge: I have tried 'Clip' in 'Data ...
user avatar
0 votes
0 answers
73 views

Getting ERROR 010161 in geopackage using ArcMap

I am using ArcMap 10.7.1. I'm trying to share a model via geopackage. The model works fine while open in my .mxd file and shares without any errors but when I open the newly saved geopackage I receive ...
user avatar
0 votes
0 answers
19 views

ExtractByMask ignoring my set workspace, saving to Default.gdb instead

I am calculating NDVI and then want to mask it with a vector file. I set my workspace a gdb and the NDVI raster calculator function saves to my gdb but the extract by mask saves to the Default.gdb. ...
user avatar
  • 19
0 votes
0 answers
36 views

QGIS Invalid cutline polygon when cutting a raster with mask

I am working with QGIS 3.10, I should cut some rasters with a vectorial mask , but whenever I do it, it gives me error: 'Invalid cutline polygon' and the operation provides a raster with pixel values ...
user avatar
  • 165
1 vote
1 answer
1k views

Using 'updateMask().not()' in Google Earth Engine

I am trying to mask out part of an image(tiff) with another image(tiff) using the 'updateMask' in google earth engine but I keep getting an empty output. The '.not()' is supposed to give the opposite ...
user avatar
0 votes
0 answers
23 views

Input feature mask name with variable - error 865

I have 73 raster files, with 73 corresponding shapefiles. I have to extract each of these raster by their corresponding shapefiles. I tried to call the shapefile using %Name%, since it has the same ...
user avatar
0 votes
2 answers
609 views

Extract pixel values of dataset (NetCDF) based on shapefile in R

I want to extract certain pixel values from a raster stack/brick from one layer (there are two Layers stored in the data - RSS_TOP and RSS_SUB --> if possible I would take both, or separately as ...
user avatar
2 votes
1 answer
1k views

Naming raster layers in a rasterstack with the same name

I have a for loop where I loop layers from a rasterstack into a predict function, which requires the output of a model and two raster files, including one layer for the present ("rastFile") ...
user avatar
-1 votes
1 answer
563 views

GeoJSON to masks [closed]

I need to use the GeoJSON file and TIFF images to produce masks. Is there a Python program that takes GeoJSON file and TIFF image as input and produces masks?
user avatar
1 vote
1 answer
328 views

Add "buffer" around mask (R, raster)?

I am working with a RasterStack, from which I only need the data for a certain region, defined in a SpatialPolygonsDataFrame. I used the following code which works well: test.ex <- crop(dat.stack, ...
user avatar
  • 177
0 votes
1 answer
256 views

How to get the NDVI value and the coordinates of each pixel within a geometry? [closed]

I would like to know how to extract the NDVI values from a list of points and export them in a file in CSV format with the following structure: LAT / LONG / NDVI. I managed to get to a certain point ...
user avatar
1 vote
1 answer
2k views

Error on Clip Raster By Mask Layer (QGIS)

Can not seem to figure out this problem when i am running Clip Raster by Mask Layer function: > INFO gdalwarp -of GTiff -cutline "C:/Users/user/Downloads/gis files/final 23.05.2020.shp" -cl "final ...
user avatar
-1 votes
1 answer
290 views

How to draw polygon and extract temperature data from NC file using Python? [closed]

I am trying to draw a polygon in the NC file and extract temperature value from this polygon using Python. Is there any easy way to do this?
user avatar
1 vote
1 answer
31 views

Extract proportion of raster by several rectangles

I have quite big raster and I 7 restangle polygons. What I need is to extract the raster so the result is 7 small TIFF tiles ideally using QGIS (possibly also ArcGIS but it's really slow here). Clip ...
user avatar
  • 355
5 votes
1 answer
9k views

Masking NetCDF time series data from shapefile using Python

I have a 3-D time-series precipitation data (187 x 1800 x 3600), stored in a NetCDF file. I need to obtain the precipitation data for a shapefile. import matplotlib.pyplot as plt from netCDF4 import ...
user avatar
  • 53
4 votes
1 answer
284 views

Extract pixel values in raster stack using shp

I am using the following code to extract mean pixel values over an area represented by a polygon: mean<-lapply(S2_stack, FUN=function (S2_stack) {data.frame(mean=extract(S2_stack, polygons2, fun=...
user avatar
  • 1,058
1 vote
0 answers
53 views

Extracting Climate classifications from raster using multiple polygon shapefiles

I have performed a cluster analysis on geographic locations (national and sub-national level) in Matlab. I have also written code to write the shapefiles for each of the locations in a cluster to it'...
user avatar
  • 11
1 vote
0 answers
34 views

Mask raster time series

I am quite new on spatial R. I would like to apply the land mask to monthly SST data from https://www.esrl.noaa.gov/psd/data/gridded/data.noaa.oisst.v2.highres.html. I tried to use "mask" from the ...
user avatar
2 votes
2 answers
971 views

extract() while keeping polygon ID in output

im trying to extract the mean from a satellite imagery. The point is, that when Im using this code (simplified for this example): > semana21 <- raster("Semana21.tif") > poly <- ...
user avatar
  • 47
0 votes
0 answers
51 views

Interpolating surface as though bare earth DEM after using Extract by Mask in ArcMap

I have some stone wall features that I need to determine the height of in ArcGIS Desktop. I have extracted the features out of the DEM by using the extract by mask tool. Now I need a method for ...
user avatar
3 votes
0 answers
392 views

Alternative to Rasterio Mask module for clipping a raster using masked geojson

I am clipping a raster (.tif file) using a mask vector (.geojson) file. with rasterio.open(url) as src: out_image, out_transform = rasterio.mask.mask(src, shapes, crop=True) But, this ...
user avatar
  • 719
1 vote
2 answers
988 views

Extract images parts from GeoTIFF file using polygons in a shapefile

I would like to know if there is any way that I can extract images from a GeoTIFF file using an ESRI shapefile which contains shapely polygon data for specific locations in the image in Python. I ...
user avatar
  • 19
2 votes
0 answers
77 views

Is there a way to create a DEM that follow the point cloud so you don't need to clip the DEM after?

I would like to create a DEM from an XYZ file (gridded 0,25x0,25) with 0,25 cell. I'm wondering if there is a way so that my interpolation follows my point cloud, instead of covering a rectangle like ...
user avatar
0 votes
2 answers
1k views

Mask raster function in R not working to extract values in one raster based on conditions in another

require: raster package I am having trouble masking values of one raster using values in another. This is similar to this question: https://stackoverflow.com/questions/51716315/how-to-subset-...
user avatar
0 votes
0 answers
40 views

Masking Landsat-8 and Modis (Aqua) with same shape file doesn't result in same shape

I was trying to mask Landsat-8 and Modis (Aqua image). FYI, I have converted the MODIS image to the same projection as Landsat and same resolution as 30m. Finally once i am done with masking using ...
user avatar
  • 163
1 vote
1 answer
236 views

Is there an alternative function which does the same thing as clip raster by masked layer on QGIS?

I am having some technical problems with the clip raster by masked layer and I faintly remember using a different method a long time ago for a similar problem. Anybody familiar with another function?
user avatar
2 votes
0 answers
154 views

Mask with ring polygon in R?

I'm trying to mask a raster with a ring polygon using the function raster::mask, but only recognizes the outer edges of the polygon, can anyone help me with this? I only need the pixels within the ...
user avatar
  • 49
0 votes
1 answer
505 views

Count number of pixels from .msk in Python to derive study area size

Apologies I am totally new to GIS in Python. I am trying to find out the total area of the Barents Sea mask the NSIDC use to calculate their products and therefore I need to know how many pixels the ...
user avatar
  • 3
1 vote
1 answer
777 views

How to mask a raster layer to only include specific values in QGIS?

I'm attempting to reduce a raster layer, wherein each point represents night-time luminosity/intensity of city lights, to include only those pixels with values in the top 10% of values. Effectively, I'...
user avatar
  • 55