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 outToScreen == "true": py_gp.print_pnts(outPnts, arcpy)
gp.AddMessage(str(theReturned[j])) #Get the points from the original grouped points supportMABE = OptDesignHelper.supportPnts(pntList[i], ndx[0:mq]) gp.AddMessage("\n" + "support points " + str(supportMABE)) outPnts.append(supportMABE) #, aVal]) # ##gp.AddMessage("Iter, mq, Time ") ##for i in TimeMQ: ## gp.AddMessage(str(i[0]) + ", " + str(i[1]) + ", " + str(i[2])) # if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#", "#"]] gp.AddMessage("here" + str(outPnts)) py_gp.createPointFile(outFC, outType, "#", outPnts, fieldsToAdd, gp) gp.AddMessage("\n" + "You can join the original table to " \ + "this shapefile table if you want other attributes." + "\n") if outCSV != "#": PM.to_CSV(outCSV, TimeMQ) #------------------------------------------------------------------------------- #five points which form an ellipse #pnts = [[3.0,3.0],[6.0,9.0],[12.0,10.0],[15.0,5.0], [13.0,2.5]] #five points # #those 5 points plus some inside the ellipse # #pnts = [[3.0,3.0],[3.1, 3.1],[4.0,4.0],[5.0,5.0],[6.0,9.0],[12.0,10.0],[13.0,2.5],[15.0,5.0]] # #standardize the points #
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) # if outToScreen == "true": py_gp.print_pnts(outPnts, arcpy)
gp.AddMessage(str(theReturned[j])) #Get the points from the original grouped points supportMABE = OptDesignHelper.supportPnts(pntList[i], ndx[0:mq]) gp.AddMessage("\n" + "support points " + str(supportMABE)) outPnts.append(supportMABE) #, aVal]) # ##gp.AddMessage("Iter, mq, Time ") ##for i in TimeMQ: ## gp.AddMessage(str(i[0]) + ", " + str(i[1]) + ", " + str(i[2])) # if outFC != "#": fieldsToAdd = [["Group", "LONG", "9", "#", "#"]] gp.AddMessage("here" + str(outPnts)) py_gp.createPointFile (outFC, outType, "#", outPnts, fieldsToAdd, gp) gp.AddMessage("\n" + "You can join the original table to " \ + "this shapefile table if you want other attributes." + "\n") if outCSV != "#": PM.to_CSV(outCSV, TimeMQ) #------------------------------------------------------------------------------- #five points which form an ellipse #pnts = [[3.0,3.0],[6.0,9.0],[12.0,10.0],[15.0,5.0], [13.0,2.5]] #five points # #those 5 points plus some inside the ellipse # #pnts = [[3.0,3.0],[3.1, 3.1],[4.0,4.0],[5.0,5.0],[6.0,9.0],[12.0,10.0],[13.0,2.5],[15.0,5.0]] # #standardize the points #