New answers tagged

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 &...
Brent Edwards's user avatar
0 votes

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 ...
lusk's user avatar
  • 111
2 votes

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 ...
remi.braun's user avatar
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 ...
user2856's user avatar
  • 64.8k

Top 50 recent answers are included