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:

  1. check to make sure the needed columns are present ("EO_ID_ST", "SNAME", "SCOMNAME", "RA")

  2. explode multi-part polys to single-part. If you don't have any multi-part polys, that is OK.

  3. calculate area for each polygon, calculate how many points to put in each polygon

  4. 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.

  5. create random points in each polygon (GRTS is good because the pts are spatially balanced).

  6. write the random points to a shapefile (ending with _RanPts.shp); write a bit of info to the tracking DB.