I have a layer of many points. From those, I need to select only those, that meet condition of having atleast two other points, in specified distance (lets say for example 100 meters) but where these points share the same value of an attribute at the same time aswell.
To be more specific, my points have an attribute "year" and the values are 2015-2020. What I want, is to find a groups of those points, that have atleast 2 other points of the same year in selected distance.
The result should be something like this, selecting a nearby group of points from the same year.
I believe, that there is "stupid" way of doing it by making at first a multiple layers for each year separately and then with the help of buffer, but since the problem, I am trying to solve is a little bit more complex, than I described, I would be making so many layers, that it makes this solution unrealistic.
How do I do this using ArcGIS Pro?
Best Answer
ArcGIS Pro 3.0.2
Edit 2: Spatial Join comes with a
Join_Count
field. So you should be able to just filter forJoin_Count >= 3
.I wanted to add that if you know you're looking for features where a certain attribute is equal to a predetermined value, then you can actually filter for
field = value
first, then do the self-spatial join since only the selected records will be processed. This would allow you to skip that step with the adding fields to the join output.Original Answer
The first thing that comes to mind is you can try spatial join the layer to itself, then select by attribute.
Spatial Join
toolTarget Features
andJoin Features
Join Operation
asone to many
. Note: You can set this toone to one
if you don't care which feature is within a distance and you just want to know if a feature has something within certain distance.Within a distance
set to whatever you want. I did 100ft just for ease.Select by Attribute
to find your desired records. I didfield <> field
, but you'll probably do the opposite and havefield = field
.If you choose
one to many
, then you'll have duplicate records, one for each feature within the specified distance. If you choseone to one
, then it will just be the first one that ArcGIS Pro selects (unless you changed themerge rule
).If you uncheck the
Keep All Target Features
, then you'll only get records that have another one within the specified distance. I left my checked out of habit, but now that I think about it you'll probably want to uncheck that option.Let me know if that worked for you!