Skip to content

Instantly share code, notes, and snippets.

@sgillies
Created February 4, 2015 21:38
Show Gist options
  • Select an option

  • Save sgillies/4b4bc949079b7c77164b to your computer and use it in GitHub Desktop.

Select an option

Save sgillies/4b4bc949079b7c77164b to your computer and use it in GitHub Desktop.
unary union
>>> from shapely.ops import unary_union
>>> from shapely.geometry import shape
>>> unary_union([shape(g) for g, v in shapes(red, mask=(red < 250))])
<shapely.geometry.multipolygon.MultiPolygon object at 0x107c1b5d0>
>>> unary_union([shape(g) for g, v in shapes(red, mask=(red < 10))])
<shapely.geometry.multipolygon.MultiPolygon object at 0x105844310>
>>> import shapely
>>> print shapely.geos.geos_version
(3, 4, 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment