Select to view content in your preferred language

Extract a buffer and the features it contains

1749
3
03-08-2014 11:43 AM
NitaHuff
Emerging Contributor
Hi I have zip code point data and a multi ring buffer I'd like to be able to clip the point file by it's respective ring and I can't seem to get it to work Ive tried splitting the point file by the buffer layer clipping and the select tool in the extract tool kit.  The latter works but when you open the attribute table it only shows the data for one point in the layer even though there are multiple points within the buffer.  please help
0 Kudos
3 Replies
RichardFairhurst
MVP Honored Contributor
Hi I have zip code point data and a multi ring buffer I'd like to be able to clip the point file by it's respective ring and I can't seem to get it to work Ive tried splitting the point file by the buffer layer clipping and the select tool in the extract tool kit.  The latter works but when you open the attribute table it only shows the data for one point in the layer even though there are multiple points within the buffer.  please help


Stop thinking in terms of clipping.  Use Spatial Join where the points are the Target input and the multi-ring buffers are the Join input using the One To Many option.  This will automatically preserve the buffer ObjectIDs in a field called Join_FID and handle overlapping buffers or buffers that do not overlap equally well.  The point will multiply in the case of overlapping buffers or where it touches the edge of two adjoining buffers, but it will remain just a single point if it is inside only one buffer.  The Spatial Join will create a new point file where every point has all of its original attributes plus the separate attributes of each ring buffer it is intersected by.

Now you can create a Model Builder Attribute Iterator or a Python cursor to read all of the ring buffer unique IDs into a variable and possibly another variable for the buffer size and use those variable to set a definition query on the point layer to only show those points with the current ring Join_FID that fell in the buffer being read for that iteration.  Now you can use Copy or Feature Class to Feature Class to export each point set to its own point feature class with a name that is modified to include the variable value of the ring buffer FID and buffer size of each iteration.  When it is done you will have have achieved "clipping" by the ring buffers if I am not mistaken.

With this approach at any stage you have the option of deciding that you don't need or want to use separate point layers and just use the original Spatial Join output in your map.  This would be best if you wanted a layer that keeps adjusting the point set shown by using a definition query that responds to user input using an Add-On.  Or else set a definition query on an initial layer for one buffer value and then copy the layer and alter the definition query for each buffer point set you want to see in separate layers without having to constantly change the source of the layer.  Or use Categorized symbology to symbolize them differently in a single layer.  Or you may want to perform analysis where every point of every buffer has a Unique ID relative to all other buffer points in a single field rather than having to manage multiple unique ID fields and overlapping Unique ID values stored in separate layers.

My suggested approach automatically makes all of the above options available to you and each approach has its uses for different data analysis or presentation purposes.  It is a "both/and" model, not an "either/or" model.
0 Kudos
NitaHuff
Emerging Contributor
Thanks I'll give this a try ultimately my goal is to run network analyst to determine the distance and time (round trip) it takes to get from the points to a set destination and I needed a way to tell what points were in each buffered area so I can get an overall average for    each buffer.  I'm trying to avoid double counting so maybe I''ll try one of the latter methods first
0 Kudos
RichardFairhurst
MVP Honored Contributor
Thanks I'll give this a try ultimately my goal is to run network analyst to determine the distance and time (round trip) it takes to get from the points to a set destination and I needed a way to tell what points were in each buffered area so I can get an overall average for    each buffer.  I'm trying to avoid double counting so maybe I''ll try one of the latter methods first


There are ways to determine if you have overlapping points generated by overlapping buffers.  You would have to describe the rules you would want to follow for choosing one buffer over another, but the technique is the same.

Assuming you are at 10.0 or higher, calculate a field on the Spatial Join output called X_Y_Link and use this calculation if you use State Plane coordinates, or modify the number format for other coordinate systems:

Parser:  Python

Use Codeblock: checked

Pre-Logic Script Code:
def Output(FirstPoint):
  FPX = round(float(FirstPoint.X), 4)
  FPY = round(float(FirstPoint.Y), 4)
  return "{%(FX)012.4f}{%(FY)012.4f}" % {'FX': FPX, 'FY': FPY}


Expression: Output(!Shape.FirstPoint!)

Now you can use the X_Y_LINK field to perform a Summary Statistics operation where this field is the case field and find all instances where the Frequency is higher than 1.  You can get any summary values like Min and Max of the buffer FIDs associated to the points.  then you have to decide what you want to do about assigning the points to only one of the buffers.  Probably I can come up with a method if you can describe your rules for making that choice.
0 Kudos