Hi Everyone,
I took a large file geodatabase containing point data from multiple years and then used the select by attributes tool to select and create new layers of the data separated by year and home range. I then wanted to assess the proximity of the points in each new layer to the nearest neighboring home range. I started using the near tool to calculate this, but to my dismay I noticed that though the results were seen in each attribute table right after running the tool, the results would disappear soon as the tool was run using the next layer. Do you all know why this might be happening? On additional thing I have noticed is that when I run the tool, all of the layers I made by selecting the points and creating a layer from the selection lock up and the results are also appended to the original layer I made the other layers from, but the results from only one layer are kept after each time the tool is run. Thank you in advance for any help. Thank you for any advice. I am using ArcGIS Pro version 2.60. Thanks again.
I guess you meant that the NEAR_FID and NEAR_DIST values are overwritten by next run. That's how it is in the older versions of Pro. In order to keep the result for every run, you would need to do the following:
- Use Add Field tool to add a new field, say NEAR_FID1, after the first run.
- Use Calculate Field tool to calculate NEAR_FID1 = NEAR_FID, basically copying the first result to a new field.
- Do the same for NEAR_DIST.
Then run the next Near process. The new values will be written into the default fields.
In recent versions of Pro (2.9 and 3.0), you can specify your own field names for each run. Hope you will upgrade to recent build soon. 🙂
Hi Dan Lee,
Is this true even if I am asking the Near tool to do use different input layers in each run? Should not the values in each layer's attribute be considered distinct. Thanks so much.
If you use the same Input Features with different Near Features, yes, each time the values in the two fields in the Input Features will be updated.
Hi Dan Lee,
In this case I am actually using different input features and different near features. However, the input features were created using the "Make layer from Selected Features Tool" from the same original layer. It appears that the program is still considering each of the layers as linked to one another and to the original layer. Is there a way to break that link so taht the tool treats each as a distinct layer as I had intended? Thank you so much for your assistance. I really appreciate it.
Instead of Make Layer from Selected Features, once you have your selection, can right click, Data, Export features and it will let you create a new feature class with only the selected features and will be it's own distinct layer.
R_
A feature layer points to a feature class. You can create different layers from the same feature class and they all point to the same feature class table. When you run Near tool on a layer made from the feature class for the first time, it adds NEAR_FID and NEAR_DIST to the original feature class table. Any subsequent runs of Near tool on layers made from the same feature class will update the two fields. You can either do what I described to save the fields to new fields, or you can use Copy Features to save each result of Near to a feature class on disk.