Skip to content

Commit

Permalink
Merge pull request #202 from jbouffard/mask-fix-2
Browse files Browse the repository at this point in the history
Mask Can Now Take Either a List or Just a Single Item
  • Loading branch information
echeipesh committed May 15, 2017
2 parents 9732ee2 + 9572a8d commit 7f0b1de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions geopyspark/geotrellis/rdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,9 @@ def mask(self, geometries):
Returns:
:class:`~geopyspark.geotrellis.rdd.TiledRasterRDD`
"""

if not isinstance(geometries, list):
geometries = [geometries]
wkts = [shapely.wkt.dumps(g) for g in geometries]
srdd = self.srdd.mask(wkts)

Expand Down
2 changes: 1 addition & 1 deletion geopyspark/tests/mask_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class MaskTest(BaseTestClass):
'extent': extent,
'tileLayout': layout}}

geometries = [Polygon([(17, 17), (42, 17), (42, 42), (17, 42)])]
geometries = Polygon([(17, 17), (42, 17), (42, 42), (17, 42)])
raster_rdd = TiledRasterRDD.from_numpy_rdd(BaseTestClass.geopysc, SPATIAL, rdd, metadata)

@pytest.fixture(autouse=True)
Expand Down

0 comments on commit 7f0b1de

Please sign in to comment.