[R-sig-Geo] jitter within polygon

Baldwin, Jim -FS jbaldwin at fs.fed.us
Sat Jan 28 06:46:55 CET 2017


Sounds like you need a "point-in-polygon" routine to determine if the jittered point is still within the polygon.

R has several such routines.  Here are two:

  pnt.in.poly in the SDMTools package
  point.in.polygon in the sp package

Mathematica has several options, too.

Jim



-----Original Message-----
From: R-sig-Geo [mailto:r-sig-geo-bounces at r-project.org] On Behalf Of Paul Lantos
Sent: Friday, January 27, 2017 9:30 PM
To: r-sig-geo at r-project.org
Subject: [R-sig-Geo] jitter within polygon

I am trying to figure out how to randomly jitter points within an overlying polygon structure.

I can easily jitter the points themselves, but I would like this to be constrained by the boundaries of polygons containing the points.

This isn't for visualization - I can do that easily enough in GIS. I actually need to generate coordinates.

Thanks,
Paul

Paul M. Lantos, MD, MS GIS, FIDSA, FAAP, FACP                       Contact
Departments of Internal Medicine and Pediatrics                           919-684-6355 (Pediatric Infectious Diseases)
    Pediatric Infectious Diseases                                                                919-681-8263 (Hospital Medicine)
    General Internal Medicine                                                                    paul.lantos at duke.edu
Duke University School of Medicine                                                     @PaulLantos
Duke Global Health Institute


[[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo




This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.



More information about the R-sig-Geo mailing list