How to generate random geo-coordinates within a given radius
1–10 of 57 posts
Re: How to generate random geo-coordinates within a given radius
#2Re: How to generate random geo-coordinates within a given radius
#3Re: How to generate random geo-coordinates within a given radius
#4Buffer your point to create a polygon then use ST_PointOnSurface (or equivalent) in any competent spatially-enabled DBMS to create a point guaranteed to intersect the bounding polygon. Trivial in SQLite, PostGIS, etc.
Re: How to generate random geo-coordinates within a given radius
#5Buffer your point to create a polygon then use ST_PointOnSurface (or equivalent) in any competent spatially-enabled DBMS to create a point guaranteed to intersect the bounding polygon. Trivial in SQLite, PostGIS, etc.
GIS buffer polygons were magical when I first stumbled upon them.
Re: How to generate random geo-coordinates within a given radius
#6Re: How to generate random geo-coordinates within a given radius
#7This raises a couple of interesting questions.
1. How do you stop someone from finding the actual property location by querying that map a bunch of times and averaging the positions returned?
2. Are there any negative consequences for the people whose property a displaced marker ends up on? For example, if someone is using the map lookup to find the home of a rival gang officer in order to do a drive by attack, and I happen to live down the street, I really don't want that marker showing up on my house.
Rather than a displaced marker, maybe divide the map into rectangular or hexagonal regions, and just highlight the region containing the property.
Re: How to generate random geo-coordinates within a given radius
#8If the rationale is privacy this is probably not the algorithm you want to use, especially if it's possible to force the generation of multiple random points (e.g. by refreshing the map). If you're using a circle with a fixed radius just 3 points would be enough to exactly locate the center. A variable radius could take more, but since the distribution is uniform each additional point would significantly improve the…
Re: How to generate random geo-coordinates within a given radius
#9> On a previous project we needed to show markers on a map to indicate there was a property, but for privacy reasons we wanted to show the marker on the map close to the property but not at the exact location of the property. So we needed to generate random points within a fixed distance of the original point location This raises a couple of interesting questions. 1. How do you stop someone from finding the actual pr…
Re: How to generate random geo-coordinates within a given radius
#10> On a previous project we needed to show markers on a map to indicate there was a property, but for privacy reasons we wanted to show the marker on the map close to the property but not at the exact location of the property. So we needed to generate random points within a fixed distance of the original point location This raises a couple of interesting questions. 1. How do you stop someone from finding the actual pr…