a guest Jun 16th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. thisFile = "yourFileRoot"
  2. with rasterio.Env():
  3.     with'_AVE_DSM.tif') as src:
  4.         with'_AVE_MSK.tif') as msk:        
  5.             image = # first band      
  6.             mask = # first band
  7.             results = ({'properties': {'altitude': v}, 'geometry': s} for i, (s, v) in
  8.                  enumerate(shapes(image, mask=mask, transform=src.transform)))
  9. thisGeoData  = gp.GeoDataFrame.from_features(list(results))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand