2

I am trying to create 100 random points, 1 within 500m of 100 points I already have. I have created a buffer and can easily create 1 random point in each, but now I want those points to lie on a polyline e.g. road in that area.

I have clipped the line layer and can get 1 point per line (road) but I only want one point in the buffer. If a buffer contains 10 roads then I get 10 random points in that area. I tried dissolving the roads but then I only get 1 point for all the buffered areas.

  • 1
    Can you please clarify the opening sentence, especially 1 within 500m of 100 points I already have? Perhaps spell out the exact problem, eg "I am trying to collect samples randomly-distributed along a road, where samples must (or must not) fall within 500m of existing samples" – Stephen Lead May 5 '15 at 23:11
1

If you are trying to randomize your original points, you may want to take a look at the Point Randomizer script rather than using the buffer method.

It is possible (with a Spatial or 3D Analyst extensions, or an Advanced license) to use the Create Random Points tool and constrain the points to fall on lines. You could take your buffers and intersect them with the roads to get the candidates. This potentially leads to a similar issue you have with dissolving the roads in your current workflow, because your method of dissolve is creating a single feature for all the roads. Each feature gets the specified number of points so you'd need all roads within a buffer to be one feature, but each buffer's roads to be separate features.

You should be able to get this by Intersecting the roads with the buffers, and then dissolving on buffer FID (making sure to allow multi-part features). If your buffers at all overlap you'll get some 'extra' features. The roads for the parts of each buffer that aren't overlapping will be two features, and then you'll have two duplicate features for all the roads within an area of overlap. However the dissolve on buffer FID should take care of that so you get one road feature per buffer.

Another option, if you already have the points and just want them on the lines, is to look at just snapping them to the nearest line. Answers at Snapping points to lines in ArcGIS Desktop and automate using VBA? cover that (particularly the first one using the Near tool, or alternatively the Generate Near Table tool). The Snap tool may also work (requires Standard or Advanced license and be sure to make a copy of the random points because the tool directly modifies the data, it does not create an output layer).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.