Questions tagged [rasterio]

Clean and fast and geospatial raster I/O for Python programmers who use Numpy

111 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
36 views

Creating a raster file with multiple attributes from numpy arrays?

I have 2 numpy arrays (same dimension) which I would like to use to create a TIF raster file with 2 attributes. I'm trying to do so with rasterio with the following piece of code: out_meta = ..... ...
0
votes
0answers
57 views

Plotting Raster Data on tkinter canvas using Rasterio

I am trying to plot my Raster Data on tkinter canvas using the following code: import tkinter from matplotlib.backends.backend_tkagg import ( FigureCanvasTkAgg, NavigationToolbar2Tk) # Implement ...
0
votes
0answers
39 views

Python code error when making fusion of multispectral image and DEM

I tried to fuse 4 multispectral bands from Landsat 8 with resampled SRTM, Aspect, Slope. It should contain 7 bands: R,G,B,NIR,DEM,Aspect,Slope. The code execution generates output raster, MS bands are ...
0
votes
1answer
195 views

Error when updating a raster file with a numpy array using rasterio.write

I'm iterating through thousands of polygons. Each polygon clips a tif raster producing a numpy array. Then the numpy array values are manipulated and the tif raster is updated with those new values. ...
0
votes
1answer
544 views

Python rasterio for saving GeoTIFF files and read in ArcGIS or QGIS

After following the steps in the tutorial of the Planet website (https://developers.planet.com/tutorials/convert-planetscope-imagery-from-radiance-to-reflectance/), I want to save each individual band ...
0
votes
0answers
224 views

Different values between original raster and cropped raster with rasterio.mask

I have a large sentinel-2 image and I want to clip it according polygons which are stored in a geojson file. My code is: df = gpd.read_file(os.path.join(geojson_folder,geojson_file)) df.head() ...
0
votes
0answers
307 views

Clipping raster with different UTM zones using rasterio?

I have 2 Landsat images, with an overlapping area: The one on the left is in WGS84 / UTM32N (EPSG:32632), the one on the right is in WGS84 / UTM33N (EPSG: 32633). I have a polygon in WGS84 / UTM33N (...
0
votes
0answers
747 views

Opening numpy array to rasterio?

I have numpy array that I know bbox for and can transform like this: import rasterio.plot from rasterio.transform import from_bounds t = from_bounds(minx, miny, maxx, maxy, sorted_np[3,:,:,7].shape[...
0
votes
0answers
250 views

How to get mean of a raster with rasterio?

I'm trying to get NDVI mean for each block of a ranch. I start with cropping my raster for each block and it's work well. #-*- coding: utf-8 -*- import os, sys, shutil import numpy as np import ...
0
votes
0answers
387 views

How could I avoid extracting incorrectly closed contours from a raster with angled sides?

I'm updating a Python script which currently calls gdal_contour as a subprocess to extract contours. I'd like to replace gdal_contour with skimage.find_contours. However the output of the GDAL script ...
-1
votes
1answer
25 views

Raster overlay and analysis

I have two raster files, of the same spatial area, but different granularity of spatial resolution. Specifically, one (say, A) has cells measuring 375x375m, and the other (say, B) has cells measuring ...

1 2
3