3
votes
Accepted
Finding the centroid of every pixel in a raster Python
You can accomplish this without the nested for loops by using np.meshgrid(). I think this will speed up your processing time as well, give this script a try:
import rasterio
import numpy as np
import ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
hyperspectral-sensor × 25remote-sensing × 6
python × 5
r × 5
envi × 5
raster × 3
google-earth-engine × 3
qgis × 2
gdal × 2
data × 2
classification × 2
multi-band × 2
atmospheric-correction × 2
vegetation-index × 2
reflectance × 2
pyqgis × 1
geotiff-tiff × 1
raster-calculator × 1
software-recommendations × 1
rasterio × 1
sentinel-2 × 1
satellite × 1
resolution × 1
digital-image-processing × 1
centroids × 1