Clean and fast and geospatial raster I/O for Python programmers who use Numpy
Questions tagged [rasterio]
440 questions
0
votes
1 answer
Display Satellite Data on folium maps without nodata values
By using the below code I am trying to plot/display the .tif file (particular band or NCC image) on the folium map:
import rasterio as rio
import folium
from pyproj import Transformer
## LC08 RGB Image or particular Band Image
in_path = 'RGB.tif'…

RRSC
- 257
- 2
- 15
0
votes
1 answer
Rasterio equivalent for GDAL's GetProjection() and GetGeoTransform()?
I have a GeoTIFF that I've done a lot of processing with in OpenCV. After processing, its lost its spatial information so I need to insert it back in. In GDAL, I would just extract that from the original image before processing and then just shove…

hmnoidk
- 545
- 6
- 20
0
votes
1 answer
Error using rioXarray in Jupyter Notebook
Am trying to follow Earth Lab Earth analytics python courses. Where theres recent changes from using RasterIO to RioXArray.
I am using the exact same data provided from the tutorials which works perfectly with RasterIO, however when trying to open…

cleolara
- 1
- 1
0
votes
1 answer
Python: how to save a geotiff file using rasterio with coordinates?
I masked a geotiff raster with a shapefile as described below
import rasterio
from rasterio.plot import show
import geopandas as gpd
population = rasterio.open('myData.tif')
gdf = gpd.read_file('myFile.shp')
clipped_array, clipped_transform =…

emax
- 6,965
- 19
- 74
- 141
0
votes
1 answer
VS Code Python Interactive Window Fails to Import `rasterio`
I recently updated VS Code to 1.53.2 on Linux (elementaryOS using snap specifically). When trying to run an existing Python script in the Interactive Window, I get the error ModuleNotFoundError: No module named 'rasterio', so obviously it is not…

DurbanK
- 23
- 4
0
votes
1 answer
How to append multiple data arrays into one varibale of xarray dataset?
i am new in this field and i need a small help.
i just want to know that, what is the best way to append multiple data arrays in a variable of a xarray dataset?
each data array has a different time and value but has the same x,y coordinates same as…

Hosein shirali
- 25
- 9
0
votes
1 answer
Python Color Table Generation for Python Terracotta
I'm trying to create a color table for Terracotta as described here: https://terracotta-python.readthedocs.io/en/latest/tutorials/custom-colormaps.html.
My goal is to create a colormap that is similar to the following color ramp:
The colors are…

Craytor
- 117
- 11
0
votes
1 answer
fill holes of raster by assigned flagmask
I have a raster image with some values are nan and these are supposed to be filled by the valid values. These valid values should meet two conditions: within a certain distance to the target pixel, and are flagged as true in an input FlagMask.
The…

Xue
- 65
- 11
0
votes
1 answer
How to read PNG and add data from a tiff file to it and save it as another tiff?
I have two files. One is PNG and the other is TIFF (or .jp2). I want to read geospatial data from the satellite image (.jp2 or .tif) and "put it in" the png file, then save it as a new tif.
I'm very new to working with raster data. I'm using…

0xmtn
- 2,625
- 5
- 27
- 53
0
votes
3 answers
How to use np.unique on big arrays?
I work with geospatial images in tif format. Thanks to the rasterio lib I can exploit these images as numpy arrays of dimension (nb_bands, x, y). Here I manipulate an image that contains patches of unique values that I would like to count. (they…

Pierrick Rambaud
- 1,726
- 1
- 20
- 47
0
votes
1 answer
Comparing values in two arrays from rasterio and performing operations
I have a GeoTIFF that has two bands in it, one a "precip reflectivity" (intensity) and "precip type" (snow/rain/etc). I'm wanting to adjust precip values that are snow so I can color them differently on my final map. Here's what I'm currently doing…

Craytor
- 117
- 11
0
votes
0 answers
change geotiff data to lat lon python
Hello I have obtained a geotiff with flood risk data, I need to show on map and also get it values querying lat,lon.
import rasterio
from rasterio.plot import show
raster = rasterio.open('/content/geonode_fp_flood_category.tif')
show(raster) #show…

neavilag
- 609
- 1
- 8
- 20
0
votes
1 answer
Cannot get color plot of single band tiff image with rasterio
I want to work with TIFF files of aeronautical charts supplied by the FAA here.
The python module rasterio seems to be the right tool for my purposes and I’ve been through several tutorials and reference docs. They all work for me, but not with the…

Harry Dolan
- 1
- 1
0
votes
0 answers
GDAL cutline Syntax Error, clip Polygon from rasterfile with respect to shapefile
I have Eastcoast.shp file and my raster input file="myrasterfinal77.tif"
output file= "myrasterfinal77_out.tif"
So with respect to Eastcoast.shp shapefile i want to extract same polygon image from my myrasterfinal77.tif input file and generate a…

Sameer Rai
- 21
- 2
0
votes
1 answer
How to check given a coordinate (lat,long) if is in a raster image file (tif file) and how to extract it with NXN window?
Hi I am researching to complete a project.
The aim is by given a coordinate I can extract the image amongs the raster files.
How do I check if the coordinate that I have for example (51.3334198, 3.2973934) is in a raster image file - k_01.tif? If…

Adamtky
- 33
- 4