process_polys - PNHP/Regional_SDM GitHub Wiki
Process polygon data to prepare for modeling
See the assumptions page for more info about how EO polys should be prepared before this step
The R script (1_randomPointsInPolys.r) currently does this:
-
check to make sure the needed columns are present ("EO_ID_ST", "SNAME", "SCOMNAME", "RA")
-
explode multi-part polys to single-part. If you don't have any multi-part polys, that is OK.
-
calculate area for each polygon, calculate how many points to put in each polygon
-
apply multipliers to the points-in-polygons based on Representational Accuracy, increasing the number of points for high-precision polys, decreasing the number of points for low-precision polys.
-
create random points in each polygon (GRTS is good because the pts are spatially balanced).
-
write the random points to a shapefile (ending with _RanPts.shp); write a bit of info to the tracking DB.