Questions tagged [masking]
Covering or hiding features on a map.
58
questions
6
votes
6
answers
28k
views
Deleting polygon defined area from raster layer in ArcGIS Desktop?
Which tool do I use in ArcGIS 10.1 for Desktop to exclude areas covered by vector polygon layers from a raster layer?
I want to keep portions of the raster layers that exclude the portions covered ...
15
votes
4
answers
36k
views
Clipping raster layer with *raster* mask layer in QGIS
Given two input layers
The clip layer - an arbitrary layer (though in my case it's a float 1 band geotiff)
The mask layer - a paletted raster in which every pixel is either NO DATA or a single "...
14
votes
4
answers
14k
views
Using polygons to apply unique value to all raster cells within those polygons?
In ArcGIS 9.3, I have a raster file that I would like to "mask" with polygons, giving a single value to all the raster cells that overlap the polygons.
How can I do this?
Here's a screen shot, ...
39
votes
6
answers
29k
views
Increasing speed of crop, mask, & extract raster by many polygons in R?
I'm extracting the area and percent cover of different land use types from a raster based on several thousand polygon boundaries. I've found that the extract function works much faster if I iterate ...
11
votes
1
answer
11k
views
R raster: masking a raster by polygon also remove cells partially covered?
I want to mask out a raster based on the values of a polygon: i.e., set to NA all values of the raster that are not covered by the polygons. However, it seems that raster::mask() masks out cells (i.e. ...
7
votes
3
answers
10k
views
Changing raster cell values within polygon using QGIS GUI
How do I change the values of raster cells which are within a polygon, leaving all cell values outside the polygon unchanged?
I would like to subtract 1.5m from each raster cell value within the ...
5
votes
1
answer
3k
views
Masking pixels inside the polygons using Google Earth Engine?
I am working on a classification problem on agricultural fields. To make things easier, I first identified road, cities, water, fields, and etc. I am planning to eliminate road, cities, and water out ...
0
votes
1
answer
3k
views
Clipping Rasters with a mask layer error
I've got a NDVI layer that I'm trying to clip with a vector file but when I try and use GDAL Tools clipper I get an error. That shows up like this:
What am I doing wrong? This is before I even pick ...
12
votes
3
answers
2k
views
Considering holes/constraints in Voronoi polygon creation in QGIS?
I am trying to create voronoi polygons in QGIS that would consider "holes" in the general domain. An example would be:
I actually created the Voronois in this image using QGIS through the GRASS ...
9
votes
3
answers
13k
views
Turning shapefile into mask and calculating mean
I have been using Python to process huge arrays stored as NetCDF files. I would like to calculate the mean of an area defined by a shapefile.
I have just installed GDAL but if there are other tools I ...
8
votes
3
answers
20k
views
Remove NA from Raster Layer
I have a RasterLayer and a SpatialPolygonDataFrame.
I used the mask function to create a new RasterLayer.
The output is correct but it does include lot's of NA values.
Now I want to get rid of ...
6
votes
1
answer
8k
views
rasterio masking with GeoJSON from file issue
I'm trying to load GeoJSON from a file for use with rasterio mask on a GeoTIFF and I can't seem to get the GeoJSON to load properly. I get this error:
File "/Users/user/example.py", line 18, in clip
...
6
votes
2
answers
9k
views
Creating polygon mask in QGIS
In QGIS 3.22.5, is there possible to use polygons for the masking layer?
I want to use numerous little polygons to mask lines (only layer which consists of lines).
In ArcGIS that works just by ...
5
votes
1
answer
2k
views
How to ‘invert’ or ‘reverse’ a vector cutline when gdalwarp'ing a raster?
I have a raster of North America and I'd like to remove the larger lakes from it, replacing them with the same no-data value as the original raster.
So I downloaded Natural Earth's 10 meter lakes ...
3
votes
2
answers
9k
views
Sentinel Cloud-free Collection Google Earth Engine Code Editor
I am trying to create and map an image collection (not image or mosaic if that is even possible), where QA60 defines the Cloud-mask. I have written the code below - however, it seems the Jan2016 ...
2
votes
1
answer
2k
views
Masking GeoTIFF file after GeoJSON through rasterio - "Input shapes do not overlap raster"
So my intention is quite simple:
I have a 4-Band TIFF file I want to crop after a polygon shape. However, I'm getting the following two exceptions
WindowError: windows do not intersect
ValueError: ...
1
vote
1
answer
1k
views
Extrapolating with IDW (Feature Classes) in ArcGIS Pro?
I have been struggling to extrapolate beyond the extent of the point features input into the IDW tool of ArcGIS Pro.
I believe IDW interpolation is the method for me, i just need the process to ...
0
votes
1
answer
2k
views
Cloud mask using pixel_qa
I need to create a cloud mask using the pixel_qa band, this is the code that I have so far:
var city = ee.Geometry.Point(9.15, 45.18);
var landsat8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
// ...
15
votes
1
answer
19k
views
Is Clip (Data management) or Extract By Mask (Spatial Analyst) more efficient?
I'm trying to clip down an Orthophoto to a county boundary. I've been using the Extract By Mask Tool, but this process has been running for about 12 hours! It's gone through 2 cycles already, so I'm ...
12
votes
2
answers
1k
views
Styling specific layer by using polygon mask in QGIS?
I have a line layer and a polygon layer in QGIS:
I would like to style the part of the line layer outside the polygon using one style and the part inside using a different style:
I don't want to ...
8
votes
1
answer
1k
views
Reduce extent of raster processing in ArcPy or ArcGIS Desktop?
I need to reduce the processing extent of my raster by some sort of automatic procedure in python. Currently the borders of the dataset I've been using has anomalies (due to the classification of the ...
7
votes
2
answers
2k
views
Counting number of unmasked pixels per image in collection using Google Earth Engine
I'm trying to count the number of pixels that are masked by the cloud mask of the image collection given by the Earth Engine dataset. I have clipped my collection with a ROI and now I want to keep the ...
6
votes
1
answer
6k
views
Creating a mask with transparent pixels in Python
I have a GeoTIFF image with pixel intensities ranging between certain values. Let's say between -2 and 2 (the image is normalized). I have a certain threshold which interests me, let's sat 1. I would ...
6
votes
1
answer
641
views
Stacking and masking Landsat at the same time with rasterio
Based on answers from previous questions 1,2 and the Masking a raster using a shapefile guide from rasterio cookbook, I wrote the code below.
The code runs correctly. I would like to improve it.
1- ...
5
votes
1
answer
2k
views
How to apply a Cloud Mask in a collection?
I am trying to apply a mask cloud in a SAVI collection (LANDSAT) to get a chart with time variations between pixels.
var region = table3
Map.addLayer(table3)
var col = ee.ImageCollection('...
5
votes
1
answer
6k
views
How to reclassify raster inside polygon mask, leaving values outside as they are?
I am in the final stages of a landcover classification and need to reclassify thematic raster values that are inside different polygon masks, while leaving the values outside as they are.
Can I do ...
4
votes
1
answer
898
views
Associating country to grid cell in R?
I’m trying to solve the following problem.
I have a regular grid of points covering Europe
nx <- 361 ; ny <- 181
xmin <- -30.0 ; ymin <- 25.0
dx <- 0.25 ; dy <- 0.25
lat <- ...
4
votes
3
answers
836
views
Use Raster Layer as a Mask over a polygon in QGIS
I have a raster layer, as seen on the attached image, that works as a background of my working area. The red line, that marks the limit between the two countries, is a .shp file that, naturally, goes ...
4
votes
1
answer
2k
views
Creating water and vegetation mask via image collection?
I am a Java script and EE novice but I'm already a great fan of Google Earth Engine. I am simply trying to create a single NDVI and NDWI masked layer to work on. Below you'll find my Frankenstein of a ...
4
votes
2
answers
10k
views
Determine if point is within an irregular polygon using Python
I would like to create a mask of a grid where points are evaluated as either 1's or 0's depending on if they lay outside of an irregular (i.e. not rectangular) polygon.
I have a set of high-latitude ...
3
votes
2
answers
3k
views
Calculating water occurrence of Sentinel-1 images in Google Earth Engine
I would like to derive the occurrence of surface water bodies from Sentinel-1 image collection in the Google Earth Engine.In my example I could already compute the water mask using Otsu’s method for ...
3
votes
1
answer
810
views
Cropping raster file with GDAL warp C++ API
I need to crop a DEM raster file with a shapefile. This shapefile has many polygons. I need to calculate several variables after the crop operation.
The algorithm is written in C++ so I want to call ...
3
votes
0
answers
553
views
Expanding raster within mask by interpolating it with boundaries set to 0
I'm having a hard time trying to expand a raster within a mask. Here are some details about my case:
I'm working with glacier ice thickness rasters, which happen to be smaller than the real size of ...
3
votes
1
answer
949
views
Add a nodata mask or alpha band to read-only image?
How to add a nodata mask or alpha channel to a source image that is read-only or should be treated as such?
For example I have this satellite image that uses jpeg compression in a geotiff. Since the ...
3
votes
1
answer
570
views
Create a polygon to match non-white (or non-empty) part of a raster
I have a irregular raster with empty spaces as seen in the attached image, which is the southwest corner of my raster. I would like to create a polygon or a mask that matches the non-white regions of ...
3
votes
1
answer
268
views
Adding simple Geomasking (Donut masking) feature using PyQGIS
I would like to add a simple halo masking feature/plugin in QGIS. Halo/donut masking basically transforms (shifts) all points in a layer to a random distance between two user-provided distances. ...
3
votes
1
answer
287
views
Create a band mask based on pixel locations, not in pixel values
I have this image loaded in QGIS, with two possible values for the pixels: 1 = orange, 2 = blue
For simplification, assume it represents a province of a country.
I want to extract just the part of ...
3
votes
1
answer
2k
views
Preserve attribute table while using Extract by Mask in ArcGIS
When using the Extract by Mask function on a raster with several columns (beyond value and count) in the attribute table, the resulting raster does not have all the columns (it only has value and ...
3
votes
3
answers
4k
views
How to crop an image based on a shapefile using GeoTools
I'm writing a web application using GeoTools (it's Java running in a web container). I need to crop a raster file based on a shape file. The core GeoTools documentation and examples I can follow ...
3
votes
1
answer
3k
views
How to invert polygons (or other options for exterior styling)?
I have a shapefile containing many polygons that I want to use to mask a raster. I have tried gdalwarp -cutline <shapefile> -crop_to_cutline -srcnodata -9999 -dstnodata -9999 <source_raster&...
3
votes
1
answer
1k
views
Masking/removing polygons from shapefile
I have a shapefile containing the road traffic noise of a city.
The shapefile has 5 columns, where 'noise_in' (noise interval) ranging from 1-5 is included.
I want to remove/mask the road noise from ...
3
votes
1
answer
4k
views
Apply cloud mask to sentinel 2 image in SNAP
I want to apply one of the cloud masks in the sentinel 2 file to the sentinel image.
The sentinel 2 image I have downloaded features files concerning cirrus and opaque clouds at 10m, 20m and 60m.
...
2
votes
1
answer
779
views
How to use Turf mask when Polygon has islands in inner rings/inner rings
I am getting some weird result with turf.mask().
This is the polygon I am trying to run the mask() function with: https://gist.githubusercontent.com/Stophface/50155878441205412001247878f58b63/raw/...
2
votes
1
answer
616
views
How I get the masking area data and export data in Google Earth Engine?
Here is my code in GEE:
var CO = ee.ImageCollection('COPERNICUS/S5P/OFFL/L3_CO')
.filterDate('2018-07-04', '2018-07-05')
.select("CO_column_number_density");
var CO_merged = CO....
2
votes
2
answers
6k
views
Rasterio error: Input shapes do not overlap raster but reprojection not working
I'm trying to use rasterio (v1.0.13) and fiona to perform a raster clip on a geotiff using a geojson polygon. For reference, the clip works perfectly from the command line using GDAL:
gdalwarp -...
2
votes
3
answers
10k
views
Masking with rasterio in Python
Introduction
I have a shapefile for my area of interest (which in this case is Tehran) and also a TIF file that contains the categorical information(cloud status). In this case, I want to mask the TIF ...
2
votes
1
answer
4k
views
Creating Cloud free images out of a MOD09A1 MODIS image in GEE?
How can I mask clouds in a MODIS\MOD09A1 images in GEE?
I know I should do sth with the "Bitmask for QA", but how?
var myImgCln = ee.ImageCollection("MODIS/006/MOD09A1")
.filterMetadata(???
2
votes
1
answer
2k
views
Mask out pixels smaller than 1ha in Google Earth Engine
I am new here so please forgive any mistakes in this post:
I have a simple script to classify cultivated area vs none cultivated areas using Sentinel-2 in GEE. I want to mask out all objects that are ...
2
votes
1
answer
587
views
Can't clip vector layer from a raster layer I created
I've been trying to clip an area in a raster image which I have created from an OSM. However when I fill out the raster clipping form I get the following message.
Error 1: Output dataset. tif exists, ...
1
vote
2
answers
1k
views
How to apply a Bitmask for radiometric saturation QA in a image collection (earth engine)
I am new to earth engine and I am trying to apply a radiometric saturation mask in a image collection based on ''radsat_qa'' in earth engine data catalog for landsat reflectance tier 1.
I am trying ...