Xcent = random.uniform(L, R) Ycent = random.uniform(B, T) else: Xcent = L + ((R - L) / 2.0) Ycent = B + ((T - B) / 2.0) if binorm_stat == True: bin_max = (R - L) * 0.05 #max is 5% of width bin_min = (R - L) * 0.001 #min is 0.1% of width Xstd = random.uniform(bin_min, bin_max) Ystd = Xstd * random.random() if (binorm_rho == True): Rho = random.uniform(-1.0, 1.0) # #generate the points # pnts = PM.binormal(n, Xcent, Ycent, Xstd, Ystd, Rho) # outPnts.append(pnts) # #optional shapefile creation if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#"], ["X", "DOUBLE", 16, 7], ["Y", "DOUBLE", 16, 7]] py_gp.createPointFile(outFC, shapeClass, "#", outPnts, fieldsToAdd, arcpy) arcpy.AddMessage("\n" + "You can join the original table to " \ + "this shapefile table if you want other attributes." + "\n") # #optional csv file creation or output to screen if outCSV != "#": PM.to_CSV(outCSV, outPnts) #
lineSlope_out = lineSlope if (lineCent == "random"): if numShapes > 1: Xcent = random.uniform(L,R); Ycent = random.uniform(B,T) else: Xcent = L + ((R-L)/2.0); Ycent = B + ((T-B)/2.0) if (length < 0.0): length_out = random.uniform(1, 100) else: length_out = length # #generate the points # if scatter == 0.0: if theType == "Random": pnts = PM.line_on(n, Xcent, Ycent, lineSlope_out, length_out, "True") else: pnts = PM.line_on(n, Xcent, Ycent, lineSlope_out, length_out, "False") else: if theType == "Random": pnts = PM.line_about(n, Xcent, Ycent, lineSlope_out, length_out, "True", scatter) else: pnts = PM.line_about(n, Xcent, Ycent, lineSlope_out, length_out, "False", scatter) # outPnts.append(pnts) # #optional shapefile creation if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#"], ["X", "DOUBLE", 16, 7], ["Y", "DOUBLE", 16, 7]]
outPnts = [] for i in range(numShapes): if (ellCent == "random"): if numShapes > 1: Xcent = random.uniform(L,R); Ycent = random.uniform(B,T) else: Xcent = L + ((R-L)/2.0); Ycent = B + ((T-B)/2.0) arcpy.AddMessage("\n" + " centers(s) at... " + str(Xcent)+ " " + str(Ycent)) if (ellAngle == "random"): theta = random.uniform(-180.0, 180.0) # #generate the points # arcpy.AddMessage("type " + str(theType)) if theType == "Ellipse_annulus": pnts = PM.ellipse_annulus(n, Xcent, Ycent, theta, major, minor, major2) else: pnts = PM.ellipse_oval(n, Xcent, Ycent, theta, major, minor, major2) outPnts.append(pnts) # #optional shapefile creation if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#"], ["X", "DOUBLE", 16, 7], ["Y", "DOUBLE", 16, 7]] py_gp.createPointFile (outFC, shapeClass, "#", outPnts, fieldsToAdd, arcpy) arcpy.AddMessage("\n" + "You can join the original table to " \ + "this shapefile table if you want other attributes." + "\n") # #optional csv file creation or output to screen if outCSV != "#":
"so output is directed to screen" arcpy.AddMessage(aMsg) # #end checks # if outFC != "#": outFC = outFC.replace("\\", "/") fullName = os.path.split(outFC) outFolder = fullName[0].replace("\\", "/") shapeClass = "Point" # #collect the points # outPnts = [] # pnts = PM.rect_cwh(n, x_c, y_c, width, height) # outPnts.append(pnts) # #optional shapefile creation if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#"], ["X", "DOUBLE", 16, 7], ["Y", "DOUBLE", 16, 7]] py_gp.createPointFile(outFC, shapeClass, "#", outPnts, fieldsToAdd, arcpy) arcpy.AddMessage("\n" + "You can join the original table to " \ + "this shapefile table if you want other attributes." + "\n") # #optional csv file creation or output to screen if outCSV != "#": PM.to_CSV(outCSV, outPnts) #
if (binomCent == "random"): if numShapes > 1: Xcent = random.uniform(L,R); Ycent = random.uniform(B,T) else: Xcent = L + ((R-L)/2.0); Ycent = B + ((T-B)/2.0) if binorm_stat == True: bin_max = (R - L) * 0.05 #max is 5% of width bin_min = (R - L) * 0.001 #min is 0.1% of width Xstd = random.uniform(bin_min, bin_max) Ystd = Xstd * random.random() if (binorm_rho == True): Rho = random.uniform(-1.0, 1.0) # #generate the points # pnts = PM.binormal(n, Xcent, Ycent, Xstd, Ystd, Rho) # outPnts.append(pnts) # #optional shapefile creation if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#"], ["X", "DOUBLE", 16, 7], ["Y", "DOUBLE", 16, 7]] py_gp.createPointFile (outFC, shapeClass, "#", outPnts, fieldsToAdd, arcpy) arcpy.AddMessage("\n" + "You can join the original table to " \ + "this shapefile table if you want other attributes." + "\n") # #optional csv file creation or output to screen if outCSV != "#": PM.to_CSV(outCSV, outPnts)
# # collect the points # outPnts = [] for i in range(numShapes): if circCent == "random": if numShapes > 1: Xcent = random.uniform(L, R) Ycent = random.uniform(B, T) else: Xcent = L + ((R - L) / 2.0) Ycent = B + ((T - B) / 2.0) # # generate the points if theType == "Random": pnts = PM.circle_on(n, Xcent, Ycent, radius, "True") # random on elif theType == "Within": pnts = PM.circle_in(n, Xcent, Ycent, radius) # random within else: pnts = PM.circle_on(n, Xcent, Ycent, radius, "False") # sequential on outPnts.append(pnts) # # optional shapefile creation if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#"], ["X", "DOUBLE", 16, 7], ["Y", "DOUBLE", 16, 7]] py_gp.createPointFile(outFC, shapeClass, "#", outPnts, fieldsToAdd, arcpy) arcpy.AddMessage( "\n" + "You can join the original table to " + "this shapefile table if you want other attributes." + "\n" ) # # optional csv file creation or output to screen
# # end checks # if outFC != "#": outFC = outFC.replace("\\", "/") fullName = os.path.split(outFC) outFolder = fullName[0].replace("\\", "/") shapeClass = "Point" # # collect the points # outPnts = [] # # generate the points # pnts = PM.rect_ext(n, L, R, B, T) # outPnts.append(pnts) # # optional shapefile creation if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#"], ["X", "DOUBLE", 16, 7], ["Y", "DOUBLE", 16, 7]] py_gp.createPointFile(outFC, shapeClass, "#", outPnts, fieldsToAdd, arcpy) arcpy.AddMessage( "\n" + "You can join the original table to " + "this shapefile table if you want other attributes." + "\n" ) # # optional csv file creation or output to screen if outCSV != "#": PM.to_CSV(outCSV, outPnts) #
# #end checks # if outFC != "#": outFC = outFC.replace("\\","/") fullName = os.path.split(outFC) outFolder = fullName[0].replace("\\", "/") shapeClass = "Point" # #collect the points # outPnts = [] # #generate the points # pnts = PM.grid_ext(L, R, B, T, Cols, Rows) # outPnts.append(pnts) # #optional shapefile creation if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#"], ["X", "DOUBLE", 16, 7], ["Y", "DOUBLE", 16, 7]] py_gp.createPointFile (outFC, shapeClass, "#", outPnts, fieldsToAdd, arcpy) arcpy.AddMessage("\n" + "You can join the original table to " \ + "this shapefile table if you want other attributes." + "\n") # #optional csv file creation or output to screen if outCSV != "#": PM.to_CSV(outCSV, outPnts)
# #end checks # if outFC != "#": outFC = outFC.replace("\\", "/") fullName = os.path.split(outFC) outFolder = fullName[0].replace("\\", "/") shapeClass = "Point" # #collect the points # outPnts = [] # #generate the points # pnts = PM.grid_ext(L, R, B, T, Cols, Rows) # outPnts.append(pnts) # #optional shapefile creation if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#"], ["X", "DOUBLE", 16, 7], ["Y", "DOUBLE", 16, 7]] py_gp.createPointFile(outFC, shapeClass, "#", outPnts, fieldsToAdd, arcpy) arcpy.AddMessage("\n" + "You can join the original table to " \ + "this shapefile table if you want other attributes." + "\n") # #optional csv file creation or output to screen if outCSV != "#": PM.to_CSV(outCSV, outPnts) #
# #collect the points # outPnts = [] for i in range(numShapes): if (circCent == "random"): if numShapes > 1: Xcent = random.uniform(L, R) Ycent = random.uniform(B, T) else: Xcent = L + ((R - L) / 2.0) Ycent = B + ((T - B) / 2.0) # #generate the points if theType == "Random": pnts = PM.circle_on(n, Xcent, Ycent, radius, "True") #random on elif theType == "Within": pnts = PM.circle_in(n, Xcent, Ycent, radius) #random within else: pnts = PM.circle_on(n, Xcent, Ycent, radius, "False") #sequential on outPnts.append(pnts) # #optional shapefile creation if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#"], ["X", "DOUBLE", 16, 7], ["Y", "DOUBLE", 16, 7]] py_gp.createPointFile(outFC, shapeClass, "#", outPnts, fieldsToAdd, arcpy) arcpy.AddMessage("\n" + "You can join the original table to " \ + "this shapefile table if you want other attributes." + "\n") # #optional csv file creation or output to screen
"so output is directed to screen" arcpy.AddMessage(aMsg) # #end checks # if outFC != "#": outFC = outFC.replace("\\", "/") fullName = os.path.split(outFC) outFolder = fullName[0].replace("\\", "/") shapeClass = "Point" # #collect the points # outPnts = [] # pnts = PM.grid_rot(x_c, y_c, rot_angle, Cols, Rows, dx, dy) # outPnts.append(pnts) # #optional shapefile creation if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#"], ["X", "DOUBLE", 16, 7], ["Y", "DOUBLE", 16, 7]] py_gp.createPointFile(outFC, shapeClass, "#", outPnts, fieldsToAdd, arcpy) arcpy.AddMessage("\n" + "You can join the original table to " \ + "this shapefile table if you want other attributes." + "\n") # #optional csv file creation or output to screen if outCSV != "#": PM.to_CSV(outCSV, outPnts) #
if numShapes > 1: Xcent = random.uniform(L, R) Ycent = random.uniform(B, T) else: Xcent = L + ((R - L) / 2.0) Ycent = B + ((T - B) / 2.0) arcpy.AddMessage("\n" + " centers(s) at... " + str(Xcent) + " " + str(Ycent)) if (ellAngle == "random"): theta = random.uniform(-180.0, 180.0) # #generate the points # arcpy.AddMessage("type " + str(theType)) if theType == "Ellipse_annulus": pnts = PM.ellipse_annulus(n, Xcent, Ycent, theta, major, minor, major2) else: pnts = PM.ellipse_oval(n, Xcent, Ycent, theta, major, minor, major2) outPnts.append(pnts) # #optional shapefile creation if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#"], ["X", "DOUBLE", 16, 7], ["Y", "DOUBLE", 16, 7]] py_gp.createPointFile(outFC, shapeClass, "#", outPnts, fieldsToAdd, arcpy) arcpy.AddMessage("\n" + "You can join the original table to " \ + "this shapefile table if you want other attributes." + "\n") # #optional csv file creation or output to screen if outCSV != "#": PM.to_CSV(outCSV, outPnts)
# #establish the center and axis orientations outPnts = [] for i in range(numShapes): if (ellCent == "random"): if numShapes > 1: Xcent = random.uniform(L,R); Ycent = random.uniform(B,T) else: Xcent = L + ((R-L)/2.0); Ycent = B + ((T-B)/2.0) arcpy.AddMessage("\n" + " centers(s) at... " + str(Xcent)+ " " + str(Ycent)) if (ellAngle == "random"): theta = random.uniform(-180.0, 180.0) # #generate the points if theType == "Random": pnts = PM.ellipse_on(n, Xcent, Ycent, theta, major, minor, "True") elif theType == "Sequential": pnts = PM.ellipse_on(n, Xcent, Ycent, theta, major, minor, "False") else: arcpy.AddMessage("type " + str(theType)) pnts = PM.ellipse_in(n, Xcent, Ycent, theta, major, minor) outPnts.append(pnts) # #optional shapefile creation if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#"], ["X", "DOUBLE", 16, 7], ["Y", "DOUBLE", 16, 7]] py_gp.createPointFile (outFC, shapeClass, "#", outPnts, fieldsToAdd, arcpy) arcpy.AddMessage("\n" + "You can join the original table to " \ + "this shapefile table if you want other attributes." + "\n")
outPnts = [] for i in range(numShapes): if (annCent == "random"): if numShapes > 1: Xcent = random.uniform(L,R); Ycent = random.uniform(B,T) else: Xcent = L + ((R-L)/2.0); Ycent = B + ((T-B)/2.0) if random_rad == True: rad_max = (R - L) * 0.1 #max is 10% of width rad_min = (R - L) * 0.01 #min is 1% of width radius = random.uniform(rad_min, rad_max) radius2 = radius * random.uniform(0.5, 0.99) # #generate the points # pnts = PM.annulus(n, Xcent, Ycent, radius2, radius) # outPnts.append(pnts) # #optional shapefile creation if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#"], ["X", "DOUBLE", 16, 7], ["Y", "DOUBLE", 16, 7]] py_gp.createPointFile (outFC, shapeClass, "#", outPnts, fieldsToAdd, arcpy) arcpy.AddMessage("\n" + "You can join the original table to " \ + "this shapefile table if you want other attributes." + "\n") # #optional csv file creation or output to screen if outCSV != "#": PM.to_CSV(outCSV, outPnts)
# #end checks # if outFC != "#": outFC = outFC.replace("\\", "/") fullName = os.path.split(outFC) outFolder = fullName[0].replace("\\", "/") shapeClass = "Point" # #collect the points # outPnts = [] # #generate the points # pnts = PM.rect_ext(n, L, R, B, T) # outPnts.append(pnts) # #optional shapefile creation if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#"], ["X", "DOUBLE", 16, 7], ["Y", "DOUBLE", 16, 7]] py_gp.createPointFile(outFC, shapeClass, "#", outPnts, fieldsToAdd, arcpy) arcpy.AddMessage("\n" + "You can join the original table to " \ + "this shapefile table if you want other attributes." + "\n") # #optional csv file creation or output to screen if outCSV != "#": PM.to_CSV(outCSV, outPnts) #
"so output is directed to screen" arcpy.AddMessage(aMsg) # #end checks # if outFC != "#": outFC = outFC.replace("\\","/") fullName = os.path.split(outFC) outFolder = fullName[0].replace("\\", "/") shapeClass = "Point" # #collect the points # outPnts = [] # pnts = PM.grid_rot(x_c, y_c, rot_angle, Cols, Rows, dx, dy) # outPnts.append(pnts) # #optional shapefile creation if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#"], ["X", "DOUBLE", 16, 7], ["Y", "DOUBLE", 16, 7]] py_gp.createPointFile (outFC, shapeClass, "#", outPnts, fieldsToAdd, arcpy) arcpy.AddMessage("\n" + "You can join the original table to " \ + "this shapefile table if you want other attributes." + "\n") # #optional csv file creation or output to screen if outCSV != "#": PM.to_CSV(outCSV, outPnts)
"so output is directed to screen" arcpy.AddMessage(aMsg) # #end checks # if outFC != "#": outFC = outFC.replace("\\","/") fullName = os.path.split(outFC) outFolder = fullName[0].replace("\\", "/") shapeClass = "Point" # #collect the points # outPnts = [] # pnts = PM.rect_cwh(n, x_c, y_c, width, height) # outPnts.append(pnts) # #optional shapefile creation if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#"], ["X", "DOUBLE", 16, 7], ["Y", "DOUBLE", 16, 7]] py_gp.createPointFile (outFC, shapeClass, "#", outPnts, fieldsToAdd, arcpy) arcpy.AddMessage("\n" + "You can join the original table to " \ + "this shapefile table if you want other attributes." + "\n") # #optional csv file creation or output to screen if outCSV != "#": PM.to_CSV(outCSV, outPnts)