DOC
|
Jake I was able to get the script to work. Thank you. John
... View more
04-13-2018
12:26 PM
|
0
|
0
|
3979
|
DOC
|
Jake I am using the Convert Attachments.tbx tool in ArcCatalog 10.5 if that matters. Thanks. John
... View more
04-13-2018
10:33 AM
|
0
|
0
|
3979
|
DOC
|
04-13-2018
10:21 AM
|
0
|
0
|
3979
|
DOC
|
04-13-2018
10:20 AM
|
0
|
0
|
3979
|
DOC
|
04-13-2018
10:19 AM
|
0
|
0
|
3979
|
DOC
|
04-13-2018
10:00 AM
|
0
|
0
|
3979
|
DOC
|
I cannot get the tool to work for me. I get errors. Any ideas? Thanks. John
... View more
04-13-2018
09:37 AM
|
0
|
0
|
3978
|
POST
|
I am having similar issues and I am not able to see the Procedural Fill option either.
... View more
08-02-2017
11:56 AM
|
0
|
0
|
1479
|
POST
|
After making the change in indentation the script runs perfectly. Thank you everyone John
... View more
08-16-2016
02:46 PM
|
0
|
0
|
563
|
POST
|
Xander Thank you for your reply. I still get an error message for now. Thank you. John Error below: Traceback (most recent call last): File "H:\DispersePoints.py", line 49, in <module> main() File "H:\DispersePoints.py", line 22, in main disperse_points(fcPoints,polygon) File "H:\DispersePoints.py", line 40, in disperse_points while not inside: UnboundLocalError: local variable 'inside' referenced before assignment My code: #------------------------------------------------------------------------------- # Name: Disperse3.py # Purpose: Disperse points in multiple polygons # Author: arcpy Team xander_bakker https://community.esri.com/people/xander_bakker # http://arcpy.wordpress.com/2013/06/07/disperse-overlapping-points/ # Created: 02-dec-2013 #------------------------------------------------------------------------------- import arcpy, random def main(): fcPoints = r"H:\\CondoAddressPoints.gdb\\new_points2" fcPolygon = r"H:\\CondoAddressPoints.gdb\\new_polys" arcpy.env.overwriteOutput = True with arcpy.da.SearchCursor(fcPolygon, ("SHAPE@")) as cursor: for row in cursor: polygon = row[0] disperse_points(fcPoints,polygon) del row print "ready..." def point_in_poly(poly, x, y): pg = arcpy.PointGeometry(arcpy.Point(x, y), poly.spatialReference) return poly.contains(pg) def disperse_points(in_points, polygon): lenx = polygon.extent.width leny = polygon.extent.height with arcpy.da.UpdateCursor(in_points, "SHAPE@XY") as points: for p in points: if point_in_poly(polygon, p[0][0], p[0][1]): x = (random.random() * lenx) + polygon.extent.XMin y = (random.random() * leny) + polygon.extent.YMin inside = point_in_poly(polygon, x, y) while not inside: x = (random.random() * lenx) + polygon.extent.XMin y = (random.random() * leny) + polygon.extent.YMin inside = point_in_poly(polygon, x, y) points.updateRow([(x, y)]) else: pass # don't update location if point doesn't originally falls inside current polygon if __name__ == '__main__': main()
... View more
08-16-2016
01:30 PM
|
0
|
2
|
563
|
POST
|
Xander: I am fairly new to python and arcpy. I was curious how to get your code Disperse3.py into the correct syntax and indentation where it will run correctly. Thank you. John Shell
... View more
08-16-2016
09:56 AM
|
0
|
4
|
1903
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|