nasaharvest / crop-mask

End-to-end workflow for generating high resolution cropland maps
Apache License 2.0
94 stars 26 forks source link

Catch error where reference point is out of bounds/polygon shape #366

Closed hannah-rae closed 5 months ago

hannah-rae commented 5 months ago

The IndexError that is currently caught handles the case when the reference point is outside of the bounding box of the raster, but it doesn't handle the case of when it is outside of the polygon and thus in a masked value of the raster outside of the polygon. That is now handled by the MaskError.

I also changed the reference label to be 255 at those locations because if it's out of bounds it should be considered a "no data" point.

ivanzvonkov commented 5 months ago

Looks like some error in the area-tests, perhaps @adebowaledaniel can comment