Select to view content in your preferred language

Creating random points across a shapefile

2352
3
08-16-2011 08:53 AM
KevinOsborne
New Contributor
I have a shapefile composed of multiple polygons representing a vegetation class. I would like to sprinkle a specified number of random points throughout this vegetation class, not in each polygon of the class. I could only get 'create random points' to place a specified number of points in each poly gon of the shapefile, resulting in way too many points. Does anyone have a solution?
Tags (2)
0 Kudos
3 Replies
DanEvans
Frequent Contributor
I have a shapefile composed of multiple polygons representing a vegetation class. I would like to sprinkle a specified number of random points throughout this vegetation class, not in each polygon of the class. I could only get 'create random points' to place a specified number of points in each poly gon of the shapefile, resulting in way too many points. Does anyone have a solution?


Divide your specified number of points per polygon by the number of polygons in the feature class and use that as the specified number in the create random points tool?
0 Kudos
KevinOsborne
New Contributor
Divide your specified number of points per polygon by the number of polygons in the feature class and use that as the specified number in the create random points tool?


That makes snese but the number of points I want is actually less than the number of polygons I have by a good margin so that won't work in my situation. Any other thoughts? I think a script that randomly picks a polygon from the shapefile and then asigns one random point to that polygon and then iterates through a specified number of times would work but I do not know how to write custom scripts like that!
0 Kudos
DanEvans
Frequent Contributor
Ok, what if you make a copy of your polygons layer, dissolve it into one multipart polygon and use the create random points tool on that?

Or if create random points won't work with multipart polygons, create a new feature class with one polygon covering the whole extent of the polygons, and create the random points over that? Although if there are gaps between polygons some of your points would be between the gaps... I was going to say that you could then select only points intersecting your original polygons but then you wouldn't be able to specify an exact number of points within the polygons... hmm

Although, looking at the help files I think my first suggestion will work: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000002r000000.htm

If you are using a Constraining Feature Class that has more than one feature, and you wish to specify the total number of random points to be generated (as opposed to the number of random points to be placed inside each feature), you must first dissolve the constraining feature class with the Dissolve tool so it only contains a single feature, then use that dissolved feature class as the Constraining Feature Class.



Hope that helps!

Dan