All Questions
47 questions
1
vote
1
answer
47
views
Masking pixels which are not connected to minimum amount of other pixels with Python
I have a raster with 1s and 0s. I want to mask all pixels with 1s that are not connected to a minimum amount of 4 other pixels in the x direction and 4 other pixels in the y direction in a rectangular ...
2
votes
0
answers
104
views
Replacing values in a raster using a mask in Python
I have a tiff-file with three color bands that I want to mask in Python using a shapefile, but when I use the normal masking method with rasterio, the data points under the mask are replaced with (0,0,...
1
vote
2
answers
567
views
How to mask bands of an image based on values of one of the bands using numpy and gdal
I have a raster with two bands, and I want to mask both bands to get data where band "yod" has a value of 2011 and export a new tif file with the same two bands masked.
The following script ...
0
votes
1
answer
136
views
How to make multiclass color mask based on polygons (osgeo.gdal python)?
I know how to make binary 1-band mask in python with
osgeo.gdal.Rasterize(src, shp_file_name, burnValues=[1])
But what if I have several classes and want to make 3-band mask with different colors for ...
1
vote
1
answer
1k
views
Mask NetCDF data in Python with shapefile
Precursor to this question: Masking NetCDF data with a shapefile in that has more than one variable Python. Note: Data files are in the previous question.
I am trying to mask my polygon but I don't ...
1
vote
1
answer
4k
views
Clip a GeoTIFF based on a bounding box coordinates using rasterio
I would like to clip a geodaframe based on coordinates. Let's say that I have the following bounding box from a GeoPandas dataframe. The projection is mollweide.
gdf.boundary.plot()
gdf.total_bounds
...
0
votes
1
answer
505
views
Output raster of rasterio.mask doesn't match CRS of input [closed]
I'm trying to mask a raster with population data with my area of interest. I reprojected the original population raster according to the AOI's crs, but after masking and writing the new file, the crs ...
1
vote
1
answer
1k
views
Masking clouds on Landsat8 with Python before NDVI [closed]
I'm new to remote sensing and trying to mask clouds with Python. I'm using the same method in Earth Data Science website (https://www.earthdatascience.org/courses/use-data-open-source-python/...
1
vote
0
answers
314
views
Getting Rid of Black Boundaries from Tiff Image using Google Earth Engine
I'm getting a tiff image from earth engine using the code below, but the image I get is rectangular and surrounded by a black box.
How can I get rid of the black boundaries on the corners and get a ...
0
votes
1
answer
593
views
Clip data while reading file into Python with GeoPandas
Geopandas is able to read in only part of a file using:
roi= geopandas.GeoDataFrame(geometry)
indexed_data = geopandas.read_file("path-to-file", mask=roi)
or
geopandas.read_file("path-...
5
votes
1
answer
1k
views
Cloud mask algorithms for Sentinel-2 Level-2A data
I am trying to find the best Sentinel-2 cloud mask algorithm for Level-2A data that can be integrated in a Python script and that works well on oceanic areas.
I am working with level-2 data because I ...
2
votes
1
answer
233
views
Rasterio mask washing out result
Using the rio.mask.mask function to clip out a section of an ortho. The result .tif looks like it has been "washed" out. The pixel values from the ortho and the result are exactly the same, ...
2
votes
3
answers
12k
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
5k
views
Rasterio mask doesn't work with shapely polygon
I have raster which I want to mask with shapely polygon.According the rasterio documentation, rasterio.mask can work with shapely geometry.However, in this case, it doesn't work.
whenever I use my ...
1
vote
1
answer
667
views
Masking satellite data using shapefile
I am using Landsat data to determine NDVI for a specific region of interest (roi). However, the roi has buildings and other artificial objects that I wish to mask.
I have followed through the example ...