I am currently using a shapefile consisting of an area smaller than the entire study boundary ie. I want this to to be my overall study area. I used a raster to polygon tool and converted it to a shapefile and used the Dissolve tool to create a multipart polygon.

Now when I am creating random points and specify the constraining feature class, it is creating random points outside the polygons I possess as well. Attached is a screenshot of random points all over, instead of just within the polygons.

enter image description here

  • 1
    If the exact number of points is unimportant, you could do this in two steps: 1. Generate the random points. 2. Clip the resulting points to the polygons. You can tweak the number of points you originally create to get roughly the number you are looking for.
    – KJYDavis
    Mar 1, 2016 at 18:13
  • The number of points is important in this situation. I did think of using Clip, but would ideally like the same number of points I generate, all within polygons though. Mar 1, 2016 at 18:16
  • Maybe you should increase the Sample size until you have the required Points overlapping your blue study area. Perhaps script this.
    – klewis
    Mar 1, 2016 at 20:20

3 Answers 3


Another option is the Sampling Design Tool, which gives you the option of how to place random points...inside any feature or by specifying the number of random points in features with specific attributes.


I post this answer here because QGIS is free software and my approach is very easy to use. I tried out it with the multi part shapefile of next image where, at its attributes table, I created the field n_points with the number of random points to generate (1000).

enter image description here

In the Menu Bar of QGIS, Vector -> Research Tools -> Random Points, to get the Random Points Tool:

enter image description here

it was marked "Use value from input field" and selected n_points as input field. It was also selected the name of output shapefile. After OK, I got the following result where 1000 random points are only within a multi-part polygon and none outside.

enter image description here


What you are asking is a very common process. As you are looking for a tool for ArcGIS to automate this process your first "port of call" should always be the ArcGIS Code Sharing website, a 2 second search on that threw up the Generate Random Points tool.

Now I've not personally used this but it may behave oddly because you dissolved your data into a multipart. So are you wanting to sample each part or each constituent polygon? If it is the polygons you want to sample a set number of times the I would recommend you exploded them out into single parts again and feed that into this tool.

  • Another issue is that irrespective of the size of the polygon, the same number of points are being generated all over and essentially, biasing the randomness of generation of the points. Mar 1, 2016 at 19:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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