Created
April 6, 2018 02:47
-
-
Save whistler/696968ae70449f7a708a1aa76794f304 to your computer and use it in GitHub Desktop.
Revisions
-
Ibrahim Muhammad created this gist
Apr 6, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ from functools import reduce import shapely.geometry import geojson def merge_aois(aois): shapes = (shapely.geometry.asShape(aoi) for aoi in aois) union = reduce(lambda a, b: a.union(b), shapes) merged_aoi = geojson.Feature(geometry=union, properties={}) return merged_aoi