Questions tagged [rasterio]

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

440 questions
0
votes
0 answers

rasterio.mask returns only nan values

I want to mask some polygons onto a raster image with rasterio.mask but all I get are nan values. I have checked that they are in the same coordinate system and in GIS the layers overlap. What can be wrong? For my raster image i have used dem =…
Disa
  • 1
0
votes
1 answer

Opening a zipped .tif file with rasterio

Is there any way to open a .tif image within a .zip file with rasterio, without having to extract the .tif from the zip? I have thousands of images which are nicely grouped in zip files and I want to analyse them with rasterio. Extracting all the…
jchristiaanse
  • 103
  • 12
0
votes
1 answer

Asynchronous Simultaneous Function Calls in Python

I have been looking for an equivalent in Python to JavaScript's await Promise.all() functionality, which led me to asyncio.gather(). After having read a few explanations and followed a few examples, I haven't managed to get anything working…
0
votes
0 answers

rasterio, setting up a background image under the plot

ive some data about the world's light pollution. I want to show them in a background(world landmap) and animate the raster data year to year. I am suffering for 2 days, any ideas?
erdoganb
  • 41
  • 4
0
votes
0 answers

Correctly convert leaflet bounding coordinates to rasterio bounding coordinates

I have a raster (geotiff) I am trying to clip to the bounding box of the visible leaflet map on my webpage. To get the visible bounding box I am using map.getBounds(); in javascript then passing it over to python. I am then attempting to clip my…
James Hall
  • 53
  • 6
0
votes
0 answers

Plot geopandas dataframe on top of raster using matplotlib/gdal(numpy)/geopandas

I want to plot my geopandas objects on top of a raster. Other people have asked this question here before and all answers seems to be: convert numpy array(raster) into Rasterio object. Is there a solution to plot this without Rasterio? Seems crazy…
Qiicken
  • 43
  • 3
0
votes
0 answers

Rasterio grayscale .tif image is empty

I'm facing an issue when opening a .tif using rasterio using the code below. fp = 'image.tif' image = rasterio.open(fp) print(image.read()) When printing the content of the image, I get this [[[0 0 0 ... 0 0 0] [0 0 0 ... 0 0 0] [0 0 0 ... 0 0…
Loic
  • 13
  • 3
0
votes
1 answer

Issue with rasterio.open() on advanced datasets

I am storing a .nc file on Amazon S3 and I want to open it using rasterio.open(). I know that rasterio is supporting this feature by looking in the document: https://rasterio.readthedocs.io/en/latest/topics/datasets.html Though, I am willing to…
Hugoz13
  • 77
  • 6
0
votes
1 answer

File is not showing when applying rasterio.open()

Here is my code refPath = '/Users/admin/Downloads/Landsat8/' ext = '_NDWI.tif' for file in sorted(os.listdir(refPath)): if file.endswith(ext): print(file) ndwiopen = rs.open(file) ndwiread = ndwiopen.read(1) Here is…
0
votes
0 answers

Raster in Spyder about save, export etc

I have a problem about with Spyder. I want to saving the raster output to created with rasterio module. But where is the Created output in Spyder? I must find Because I cant export the raster Thanks :)
edaasc
  • 3
  • 2
0
votes
1 answer

how to upload tiff file to cloudinary using django rest framework?

i am using django rest framework.problem i am facing is that data in to form to arrray is comming from external api i convert it to tiff formate.How can i store this tiff file in cloudnary. ndvi_image = rasterio.open( 'ndviimage.tif',…
0
votes
1 answer

Save raster to geotiff including layer band names that show in ArcGIS

I have the following working function that saves a raster stack to geotiff using rasterio: def saveRasterToDisc(out_image, raster_crs, out_transform, output_raster_path): # save raster to disk with rasterio.open(output_raster_path, 'w', …
Zozzoy
  • 63
  • 6
0
votes
2 answers

Clipping Raster through each features of shapefile using Python

I clipped a raster file through a shapefile. Now i want to clip that raster file through each features of shapefile. If there are 5 feature in that shp i wanted to clip the raster through those 5 features and i should get 5seperate rasters as per…
0
votes
1 answer

Python3.8 GDAL Could not find gdal-config

Error [enter image description here][1] [1]: https://i.stack.imgur.com/c3qQr.png × Getting requirements to build wheel did not run successfully. #8 17.82 │ exit code: 1 #8 17.82 ╰─> [2 lines of output] #8 17.82 INFO:root:GDAL API version…
kraivit
  • 1
  • 1
0
votes
1 answer

Inverse Affine Transform - Rasterio

Is there a build in way in rasterio to compute the inverse affine transform of an rasterio.transform.Affine object? I'm currently doing the following: from rasterio.transform import Affine import numpy as np transform = Affine(29.976, 0, 5.12e5, 0,…
GuillemB
  • 540
  • 4
  • 13