geojson-random icon indicating copy to clipboard operation
geojson-random copied to clipboard

random points inside polygon bounds

Open frankrowe opened this issue 11 years ago • 3 comments

Gauging interest for this feature. Would just generate the points inside a specific polygon instead of anywhere in the world. Could also be used for lines, polygons in the future.

I have a need for this so I'm working on in it my fork right now

frankrowe avatar Jul 31 '14 17:07 frankrowe

sure, would be interested in your solution, a smart solution that doesn't just do random in bbox->expensive point-in-polygon would be interesting

tmcw avatar Jul 31 '14 17:07 tmcw

yeah, that's what I'm doing right now and it works okay, but I haven't tested for lots of points or weird polygons.

I'm guessing the other solution is to split the polygon into triangles and then rand inside those.

frankrowe avatar Jul 31 '14 17:07 frankrowe

Stopgap solution that I'm okay is the bbox functionality I just pushed to master.

tmcw avatar Jan 13 '15 22:01 tmcw