New answers tagged python-2.7
Here's a basic example using rasterio and numpy: import rasterio as rio import numpy as np with rio.open('~/rasterio/tests/data/rgb1.tif') as src: # Read the raster into a (rows, cols, depth) array, # dstack this into a (depth, rows, cols) array, # the sum along the last axis (~= grayscale) grey = np.mean(np.dstack(src.read()), axis=2) ...
I'm super late to the party, but I had the same problem today and your post came up during my google search. So I guess posting a solution could be useful to someone in the future. Anyways, I avoided the Microsoft Visual C++ crash when closing ArcMap by closing the matplotlib figure after saving it. pyplot.close(fig)
Just to complete the answer from @Mattijn, I think that will lead into a problem if the input classes overlap with the output classes. I don't want my new value to be changed by the next rule. I don't know if I loose speed but I should do a deep copy : list_dest = lista.copy() list_dest[np.where( lista < 0 )] = 0 list_dest[np.where((0 <= lista) ...
I don't know if this is a mistake (NED = geotiff('nedwashtenaw.tif') Align NED data with LS8 data) but from pyGTiff import geotiff import numpy as np LS8 = geotiff('LC80200312014149LGN00/LC80200312014149LGN00_B5_subset.TIF') NED = geotiff('nedwashtenaw.tif') # Align NED data with LS8 data NEDn = LS8.intersect(NED,nodata=,resampleType=2) New I ...
Top 50 recent answers are included