I am trying to generate around 117 random points over patchy forested landscape. As my forested landscape contaisn many polygons (28.000), and I would like to generate specific number of random points, I first dissolve
my polygon, to create multipart polygon, as speciefied in ArcGIS help.
Example of my very patchy landscape, polygons are forests, white parts are not forested:
So, to generate random points, I am using as constraints a multipart polygon and minimal distance points.
However, no matter what required number of points in number_of_points_or_field
I specify (should by 117 if I quess correctly), I always get back number around 75.
I understand that if my points cannot fit the polygon under minimal distance restriction, there is less of them.
But, I got back the same number of 75 points, even if I set lower number, i.e. 10: number_of_points_or_field = 10
.
Why does this happen?
Here is my code:
# Read input forest data
inForest = os.path.join(inWD, "patchyForest")
# Process: Dissolve feature to create single multipart polygon
outForestDiss = os.path.join(outDB, "forest_diss")
arcpy.Dissolve_management(in_features = inForest ,
out_feature_class = outForestDiss,
dissolve_field = "",
statistics_fields = "",
multi_part = "MULTI_PART",
unsplit_lines = "")
# Process: generate random points within the forested area
outPtsName = "randomPoints"
numberPoints = 117 # tried with 10, 75, 117 and I always get back number 75
arcpy.CreateRandomPoints_management(out_path = outDB,
out_name = outPtsName,
constraining_feature_class = outForestDiss,
# constraining_extent = "", # skip this one out
number_of_points_or_field = numberPoints,
minimum_allowed_distance = distanceBuff * 2,
create_multipoint_output = "POINT")
constraining_extent
out, but I still get back the same result.. 75.. I think theextent
is deprecated, if I use as a constraintfeature class
. Do you maybe have another suggestions? – maycca Oct 9 '19 at 14:54