|
POST
|
In my example above, if I calculate the distance between the points generated along the buffer line (20 m) to the original center point, they range from 19.999999999553737 to 20.000000000465356. However, they still "intersect" both geometries according to the software. I see what you're saying about n-gons, but if the software doesn't recognize it and the precision of the data almost certainly doesn't support it, then splitting hairs exactly with math doesn't do much good. Whether or not the buffers are true circles or n-gons, points falling on the boundary belong to both.
... View more
03-23-2016
03:17 PM
|
1
|
1
|
2554
|
|
POST
|
Here's another way that indicates that the boundaries are identical: >>> point = 'mypoints' # a point
... pt_geom = [i for i in arcpy.da.SearchCursor(point,'SHAPE@')][0][0] # get geometry
... buff = pt_geom.buffer(20) # buffer point by 20m
... buff_line = buff.boundary() # convert to line
... ring_buffs_fc = 'buffs' # premade multiple ring buffers (10-20m, and 20-30m)
... ring_buffs = [i for i in arcpy.da.SearchCursor(ring_buffs_fc,['SHAPE@','distance'])] # get geometries
... mypoints = [] # points container, otional
... counts = [] # counts list
... reps = 100000 # how many times to test
... for i in range(reps): # start looping
... new_point = buff_line.positionAlongLine(float(i)/reps,True) # create point at percentage along buffer line
... count = 0 # reset counter
... mypoints.append(new_point) # add point, optional
... for ring_buff in ring_buffs: # test against ring buffers
... if not ring_buff[0].disjoint(new_point): # see if disjoint
... count += 1 # add to count
... counts.append(count) # add count to list
... print (min(counts),max(counts)) # print min/max
... arcpy.CopyFeatures_management(mypoints,r'in_memory\points') # write points, optional
...
(2, 2) # each and every record intersects 2 ring buffers
... View more
03-23-2016
01:30 PM
|
1
|
3
|
2554
|
|
POST
|
<beating a dead horse> I'm guessing you want to make your legend something like the following, as you would do with most numerical classifications: 0 <= x < 20 20 <= x < 50 50 <= x < 100 but as (I think) we've shown, the "truth" with multiple ring buffers would be: 0 <= x <= 20 20 <= x <= 50 50 <= x <= 100 </beating a dead horse>
... View more
03-23-2016
12:20 PM
|
1
|
8
|
3308
|
|
POST
|
Yes, the point on the boundary creates two spatial join records.
... View more
03-23-2016
12:08 PM
|
1
|
0
|
3308
|
|
POST
|
The boundaries are shared, it's not one or the other. A point on the boundary intersects both buffer geometries.
... View more
03-23-2016
11:35 AM
|
0
|
0
|
3308
|
|
POST
|
Yes, it does seem wrong. This tool has always caught me off guard.
... View more
03-23-2016
10:55 AM
|
0
|
0
|
2381
|
|
POST
|
What is ArcPy?—Help | ArcGIS for Desktop It's hard to know where you're running into trouble.
... View more
03-23-2016
10:53 AM
|
1
|
5
|
2973
|
|
POST
|
I can't get it to work using a multipart Polygon object, but it does work by simply passing the entire flat list of points. In your case, try: mp = p1+p2
... View more
03-23-2016
10:39 AM
|
0
|
2
|
2381
|
|
POST
|
I don't have the answer, but how skewed is the result if you simply allocate each inspection to the nearest station? The problem with iterating by station is that the first station will be very happy (they got all the most convenient 385 inspections), the second station will be happy but less so because some of their most convenient inspections may have been taken by the first station, same for the third station (which may have lost inspections to the first and second stations), and so on until the 26th station gets the remainder with perhaps some close inspections and probably a bunch all the way across town.
... View more
03-22-2016
11:24 AM
|
1
|
1
|
2225
|
|
POST
|
You can use scipy.stats.percentileofscore() for this (not sure if I installed it separate or if it came with ArcGIS). >>> import numpy, scipy.stats
... fc = 'points'
... field = 'val'
... rankfield = 'rank'
... values = [row[0] for row in arcpy.da.SearchCursor(fc, field)] # load values to list
... with arcpy.da.UpdateCursor(fc, [field,rankfield]) as cursor:
... for row in cursor:
... row[1] = scipy.stats.percentileofscore(values,row[0]) # returns percentile rank at value
... cursor.updateRow(row)
... View more
03-18-2016
02:39 PM
|
2
|
0
|
5969
|
|
POST
|
Codeblock (Python): dict = {}
def myFunc(myClass):
global dict
dict[myClass] = dict.get(myClass, 0) + 1
return myClass + "-" + str(dict[myClass]) Expression (change to your field name): myFunc( !ST_NAME! )
... View more
03-18-2016
09:39 AM
|
2
|
0
|
1357
|
|
POST
|
Then you'll have to use an iterator, collect the pivot point coordinates in a variable, and pass those using inline variable substitution. But, that's about as much help as I'll be with Modelbuilder.
... View more
03-18-2016
09:35 AM
|
1
|
2
|
2145
|
|
POST
|
See this thread for how you can create a dictionary to work with incremental numbers by class, in the field calculator: https://community.esri.com/message/595324#comment-595324 In that case, the dictionary would look like {1:x, 2:y, 3:z, ...} ...where x,y,z are incrementing. In your case, the dictionary would look like {'MAIN ST-':x, 'B ST-: y, ...} where x,y are incrementing.
... View more
03-18-2016
09:24 AM
|
1
|
0
|
1357
|
|
POST
|
I assume you've found the Rotate tool and want to use the optional pivot point parameter. Doesn't it work to type in the xy values you want to use? edit: I'm not sure what this means: "I have a feature class that contains all attributes of a given raster dataset." You do have a raster to rotate, correct?
... View more
03-18-2016
09:15 AM
|
1
|
4
|
2145
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-25-2015 01:51 PM | |
| 1 | 08-30-2013 02:22 PM | |
| 1 | 04-12-2011 11:19 AM | |
| 1 | 09-17-2021 09:43 AM | |
| 1 | 04-04-2012 12:05 PM |
| Online Status |
Offline
|
| Date Last Visited |
07-15-2023
12:11 AM
|