New answers tagged rasterio
1
vote
Change values of pixels of a GeoTIFF in Python with conditions
Something like this should work :
call gdal_calc ^
--calc "((A==103)*10) + ((A==33)*20) + ((A==65)*30) + ((A==1)*40) + ((A==9)*50) + ((A==17)*60) + ((A==129)*0) + ((A==0)*1)" ^
--outfile &...
0
votes
Accepted
How to rasterize point data using average value per cell (not replace or add)
I ended up implementing this semi-manually without geocube:
import os
from typing import Union
import numpy as np
import rasterio as rio
from rasterio.transform import from_origin
def ...
2
votes
Accepted
Treat overlapping pixel when doing merge GeoTIFF images using Rasterio
The rasterio.merge function has an argument where you can specify the merging method. Availables are:
first: reverse painting
last: paint valid new on top of existing
min: pixel-wise min of existing ...
2
votes
python: GDAL raster output is distorted
Assuming the CSV XY values form a regular grid, you can treat the CSV as an XYZ raster, though you will need to extract out just the X, Y and specific "Z" column from the CSV for each band ...
Top 50 recent answers are included
Related Tags
rasterio × 795python × 570
raster × 205
gdal × 185
geotiff-tiff × 97
coordinate-system × 74
geopandas × 69
numpy × 60
rioxarray × 44
qgis × 34
masking × 29
shapefile × 26
matplotlib × 25
affine-transformation × 24
xarray × 24
clip × 23
shapely × 22
geojson × 20
netcdf × 19
sentinel-2 × 19
fiona × 19
resampling × 17
rasterization × 16
rasterstats × 16
merge × 13