Hi,
Using a shape file diving a city into 20 zones, I would like to randomly generate a GPS coordinate and test whether it is in a given zone, and keep on resampling until I have sampled 30 GPS coordinates in a given zone while ensuring that two GPS coordinates are no more than 50 meters away from each other. I think the steps to follow are:
1) Random select a GPS coordinate (using the shape file to bound the latitudes and longitudes per zone, or else it could take a while to get a first GPS coordinate in a given zone).
2) Randomly select a GPS coordinate within a 50 meter radius and check that this point is still in the same zone.
I was thinking of using gpsbound but that would only help to check whether the gps coordinate is in the correct zone. I would first need to generate the random GPS coordinate falling within the boundaries of the zone (polygon).
Any help/tips would be much appreciated!
Using a shape file diving a city into 20 zones, I would like to randomly generate a GPS coordinate and test whether it is in a given zone, and keep on resampling until I have sampled 30 GPS coordinates in a given zone while ensuring that two GPS coordinates are no more than 50 meters away from each other. I think the steps to follow are:
1) Random select a GPS coordinate (using the shape file to bound the latitudes and longitudes per zone, or else it could take a while to get a first GPS coordinate in a given zone).
2) Randomly select a GPS coordinate within a 50 meter radius and check that this point is still in the same zone.
I was thinking of using gpsbound but that would only help to check whether the gps coordinate is in the correct zone. I would first need to generate the random GPS coordinate falling within the boundaries of the zone (polygon).
Any help/tips would be much appreciated!
Comment