Questions tagged [masking]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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 ...
13
votes
3answers
10k 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, ...
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 ...
11
votes
3answers
849 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 ...
10
votes
2answers
440 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
1answer
855 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
3answers
8k views

Turn a shapefile into a mask and calculate the 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 ...
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. ...
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 "...
7
votes
2answers
5k views

combine raster with another raster mask file - gdal

I have 2 rasters in GeoTiff format. One has all of the land and water and the other is a mask file that shows either 0 for water or 1 for land. I basically want my output to just have the land values ...
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 ...
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 ...
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 ...
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
1answer
154 views

Cutting Raster using two Polygons as Masks

I am trying to cut this raster in order to drop the outside of the walls white area and the area with the dots. I made one step using as mask the green polygon but i couldn't remove the inside of the ...
5
votes
2answers
850 views

How to modify raster pixel inside a polygon?

I would like to set to novalue all the pixels of my raster inside a polygon. I'm trying the gdalwarp command line with -cutline option. But this command extract the values of my raster inside the ...
5
votes
1answer
2k views

layer mask does not mask labels, only vector data

I am using ArcGIS 10. I made a layer mask (polygon) that blocks out everyting in a number of vector layers that is outside the area of interest (outside the boundary of two districts). I successfully ...
5
votes
1answer
927 views

looping the mask in python for arcgis 10

I am working with raster data on a worldwide level with a resolution of 30 arc seconds. I need to export the data into a table format but given the high resolution you can not run the "Sample" (...
5
votes
1answer
5k views

How to create mask bands in GDAL and Python?

I have small program in Python that uses gdal and numpy to perform a logarithmic scale of some data into the RGB 0-255 range. Now this input data has a nodata value set to mask the valid values, and ...
5
votes
0answers
201 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
4answers
478 views

How to create a semi-transparent map collar in QGIS composer?

In QGIS 2.14, how can I create a semi-transparent "map collar" (white space around the outside of the page) in Composer? I imagine the map collar would be some sort of graphic shape (not a feature) ...
4
votes
2answers
202 views

Masking layers by a vector polygon layer in QGIS

I have a vector layer of buildings: and a polygon layer coloured by some quantity: and I want to mask one by the other to produce this: This can be done by setting the blend mode to "Multiply" with ...
4
votes
2answers
1k views

cloud shadow detection

I am trying to detect cloud shadows in Landsat images. I came up with producing good shadows and cloud masks. Now I'd like to implement my cloud mask adding cloud shadows. Do You have a good idea to ...
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 ...
4
votes
2answers
8k 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 ...
4
votes
1answer
379 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
1answer
493 views

Lapply function on raster iterating through SPDF polygons in R

I have a raster DTM and a SPDF. I'd need to mask a different elevation interval of the DTM within each overlaid polygon. I tried a for loop to iterate through the polygons, but as one might expect ...
4
votes
4answers
8k views

How do I create a mask where the masked area can be changed by selection?

I'm working on making a mask in QGIS to have one area(county A) outlined while the other areas(counties) are under a semipermeable layer. I already know how to do this for one selected area. But my ...
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('...
4
votes
2answers
1k views

Masking WMS (Esri Oceans Basemap) layer in ArcGIS for Desktop?

I would like to display ESRI's Oceans basemap web map service (WMS) in one of my maps, but not the whole layer, just the landmass depicting Canada as I find it a nice fit for the look I'm trying to ...
4
votes
1answer
711 views

Altering elevation of specific cells in raster layer of QGIS?

I'm looking to alter the height of some cells within a raster and it's been suggested that I do this by creating a polygon layer and use that as a mask to alter only the heights of cells within the ...
4
votes
0answers
2k views

Using polygons to create mask on 2d grid with Python?

I have some polygons (Canadian provinces), read in with GeoPandas, and want to use these to create a mask to apply to gridded data on a 2-d latitude-longitude grid (read from a netcdf file using iris)....
3
votes
2answers
664 views

Apply water mask to a raster layer

I have a vector polygon layer which represents water bodies and I have a raster layer (250m pixel NDVI values). What I need is to mask all pixels in a raster layer that intersect my water mask and ...
3
votes
1answer
2k 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. ...
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 ...
3
votes
1answer
829 views

Clipping raster file in ArcMap over the extent of polyline shape

I have a calculated raster file, overlayed on a shapefile with lines (like on figure) I would like to clip the raster in ArcMap (since it is an interpolation and out of the vector shape it is mostly ...
3
votes
2answers
2k views

Extracting raster data to multiple polygons using ArcGIS Desktop?

I have a reclassified raster dataset (10 classes) and I want to find out the area of each class contained within multiple (hundreds-to-thousands) polygons. I have all the polygons in the same ...
3
votes
1answer
94 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 ...
3
votes
1answer
1k views

Extracting raster data outside of clip

I'm trying to extract Sea Surface Temp raster (floating integer) that includes both sea temp and land surface temp. I want the data outside of a clip. I've clipped the coastline with a polygon in ...
3
votes
3answers
5k views

Changing 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 ...
3
votes
1answer
222 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
1answer
206 views

Including use of Mask in Raster > Vector conversion in QGIS

The Polygonize (raster to vector) tool in QGIS Raster > Conversion menu allows for the use of a mask, however this option is not available in the Processing Modeler. What would be the best way to ...
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
224 views

Landsat Surface Reflectancce product Python packages

I have to work with numerous Landsat surface reflectance product that I downloaded from http://landsat.usgs.gov/CDR_LSR.php. The product comes with a QA data with information on clouds and shadows ...
3
votes
1answer
1k views

How to hide some parts of an image layer with OpenLayers?

My Problem I'm currently displaying a layer image above a Google Maps base layer. I would like, when the user check/uncheck some checkboxes, that some parts of this image layer disappear, and the ...
3
votes
1answer
283 views

Reclassify raster pixels underlying certain polygons using Python

I've got a shapefile with many polygons, each of which exactly overlays a contiguous region of raster cells; an example in yellow: For some of these, I want to use the polygon as a sort of analysis ...
3
votes
1answer
802 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
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
0answers
180 views

Writing masked GeoTIFF in rasterio and visualizing in QGIS?

I have an interpolated raster, which is a masked array, that shows where the data is valid. I want to save it as masked TIFF with rasterio. To test, here's the JSON file, and the code: import ...
3
votes
0answers
702 views

Make a grid map in Leaflet

I want to draw a grid map based on the temperature values in Leaflet. Similar to the illustration below. Input data: lat, lon, temperature values, cities' names Parameters: the dimensions of the ...