isciences / exactextract

Fast and accurate raster zonal statistics
Apache License 2.0
246 stars 32 forks source link

Incorrect coverage fraction for invalid polygon #29

Open dbaston opened 2 years ago

dbaston commented 2 years ago

When a polygon self-intersects within a grid cell, it may cause the coverage fraction of that grid cell to be incorrect. Returning incorrect results is undesirable, but so is pre-checking all inputs for validity. A reasonable alternative might be to sum all of the covered cell areas and compare that to the area of the input polygon, raising an error if these differ beyond some tolerance.