-
Notifications
You must be signed in to change notification settings - Fork 4
Description
I do not think I can freely pull request, so I'm just sending the issues here with my proposed fixes that made the codes working for me. Hope this helps!
1. An admin region that is in a form of "Multipolygon" is not recognized. Instead of Line 85-86 (geo.py):
out_image, out_transform = rasterio.mask.mask(src, geom, crop=True)
no_data = src.nodata
Use this:
if type(geom) == shapely.geometry.multipolygon.MultiPolygon:
out_image, out_transform = rasterio.mask.mask(src, geom.geoms, crop=True)
no_data = src.nodata
else:
out_image, out_transform = rasterio.mask.mask(src, geom, crop=True)
no_data = src.nodata
2. "Deprecated multiplication" error. Just flip the position. Instead of Line 98 (geo.py):
rc2xy = lambda r, c: (c, r) * T1
Use this:
rc2xy = lambda r, c: T1 * (c, r)
3. "iteritems" does not work. I replaced it with "items" but still gives me a minor warning error due to predefined geometry (but it still performs), which can be fixed with pre-identifying "geometry" in the future. Instead of Line 113 (geo.py):
for col, val in adm.iteritems():
Use this:
for col, val in adm.items():
Thank you,
Joshua