SHARE
TWEET

Untitled

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 rasterio.open(thisFile+'_AVE_DSM.tif') as src:
  4.         with rasterio.open(thisFile+'_AVE_MSK.tif') as msk:        
  5.             image = src.read(1) # first band      
  6.             mask = msk.read(1) # 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
 
Top