ncss-tech / soilReports

An R package that assists with the setup and operation of a collection of soil data summary, comparison, and evaluation reports. These reports are primarily used by USDA-NRCS soil scientists in both initial and update mapping.
15 stars 5 forks source link

invalid geometry and 0 samples generated #74

Open dylanbeaudette opened 6 years ago

dylanbeaudette commented 6 years ago

There a rare cases where invalid polygon geometry will cause spsample() to throw an error. The resulting error looks something like:

cannot derive coordinates from non-numeric matrix

A simple "fix" has been implemented in the suite of sampling functions from sharpshootR. The region2/mu-comparison report is now smart enough to at least skip those groups of polygons where 0 samples were returned.

I originally spotted this issue when applying the region2/mu-comparison report to LRUs. Each LRU was associated with a single polygon, some of which had topological errors.

TODO: