Questions tagged [masking]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
13
votes
3answers
9k 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, ...
5
votes
4answers
14k 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 ...
7
votes
1answer
16k views

Clip raster layer with *raster* mask layer in QGIS

Given two input layers 1. The clip layer - an arbitrary layer (though in my case it's a float 1 band geotiff) 2. The mask layer - a paletted raster in which every pixel is either NO DATA or a single "...
29
votes
5answers
15k 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 ...
7
votes
1answer
4k 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. ...
5
votes
1answer
3k 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 ...
5
votes
3answers
6k 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 ...
3
votes
1answer
3k 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 ...
1
vote
1answer
317 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
1answer
265 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') // ...
0
votes
0answers
50 views

Clipping raster by feature using GDAL in QGIS?

I have successfully selected the feature from a shapefile (boundary) and intend to use this as a mask to clip the raster map underneath. However, having followed instructions when I open the GDAL > ...
0
votes
1answer
740 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
1answer
12k 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 ...
10
votes
2answers
428 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 ...
11
votes
3answers
831 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 ...
4
votes
1answer
363 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 <- ...
8
votes
1answer
853 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 ...
6
votes
1answer
4k 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 ...
4
votes
1answer
4k 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 ...
3
votes
2answers
5k views

How to change raster cell values within a polygon using QGIS GUI?

I would like to know how to 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 ...
1
vote
2answers
2k views

How to mask out features outside of the Coverage Layer for Atlas plugin? [duplicate]

Using the Atlas plugin for qGIS how do I set the coverage so that it will only highlight the feature(s) I want but still show the surrounding features as grayed out areas? This would have been easy ...
1
vote
2answers
467 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 -...
5
votes
0answers
181 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- ...
4
votes
1answer
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('...
3
votes
1answer
2k 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
1answer
1k 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
1answer
799 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
1answer
221 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 ...
2
votes
1answer
301 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, ...
2
votes
1answer
987 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 ...
1
vote
1answer
322 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
1answer
757 views

Restricting Tin interpolation in QGIS

I am trying to do a bathymetric map for a lake using QGIS. However, I see no option to impose a mask so interpolation does not extending beyond the boundaries of my lake. I have traced around the ...
1
vote
2answers
531 views

Resampling raster based on mask raster?

I want to resample rasters of e.g. 2 m resolution to the same raster cell size and projection of an existing raster (25 m). However I cannot really find answers how to do it properly. I managed to ...
0
votes
1answer
101 views

MODIS coastline issue

I have a few MODIS products and as I was combining my imges I realised that some of the pixels around the coastline where abit off.Is that a standard issue and if so should I use reproject or should I ...