4

My question is very simple. I have a point feature class with attributes joined to the attributes of another point feature class. I would like to, if I select a feature in the target feature class, have the feature class in the joined dataset also selected. Is there any easy way to do this?

I know a table relate will select the related entry but this is not the same for a join. Also I would rather not use a relate since it is critical for me to see the attributes of both feature classes side by side.

1

As far as I know, it is not possible to do what you want with built-in functionality without using a relate or a relationship class, unless the points were spatially the same and you could use a Select by Location query. Of course the relate option cannot function while the join is in place and may be removed from the layer by the Join, so that option is far from practical. I have not really tried a relationship class, so that could use some experimentation if the two point feature classes are in the same geodatabase.

A python add-in could do this behavior by using a cursor to read the joined data, collecting the ObjectIDs of the joined features, and then selecting them using another cursor or SQL expression. The Add-In could be a button if you want the user to manually control the firing of the code, or as an extension if you want it to respond to new selection events automatically.

1

This solution produces a new feature class, so if that is not possible in your case then this will not work for you.

You could merge the datasets together to get the desired functionality of selecting both points with the same primary key values. If you are able to establish a join between the two, this means you have a primary key in both fields, which can be used to create a new multipoint feature class.

For this, let's call the features classes A_Points and B_Points.

  1. Merge the two feature classes together. This will create an output with all of the fields from both feature classes.

  2. The primary key in A_Points will be null for the B_Point rows, and vice versa for the A_Point rows.

| A_Points.PrimaryKey | A_Points.Attribute1 | B_Points.PrimaryKey | B_Points.Attribute2 | | 1 | foo | <Null> | <Null> | | 2 | foo | <Null> | <Null> | | <Null> | <Null> | 1 | foo | | <Null> | <Null> | 2 | foo |

Note, if the Primary Key fields are the same name, the merge should put these into the same field. If so, you can skip steps 3 and 4.

  1. Select all null records in the A_Points primary key field in the merged output.

  2. Use Field Calculator on the A_Points primary key field to calculate the A_Point primary key field to equal the B_Points primary key field.

| A_Points.PrimaryKey | A_Points.Attribute1 | B_Points.PrimaryKey | B_Points.Attribute2 | | 1 | foo | <Null> | <Null> | | 2 | foo | <Null> | <Null> | | 1 | <Null> | 1 | foo | | 2 | <Null> | 2 | foo |

  1. Use Dissolve to dissolve on the on the A_Points.PrimaryKey field, and select to create Multipart features. In the statistical fields section, choose First for all fields from the A_Points layer and Last for all fields in B_Points layer. This way all values will then come over with the dissolved output.

| A_Points.PrimaryKey | A_Points.Attribute1 | B_Points.PrimaryKey | B_Points.Attribute2 | | 1 | foo | 1 | foo | | 2 | foo | 2 | foo |

Now when you select one row, it will select both points with the same primary key, and all of the attributes will be side-by-side.

  • This solution does select both points, however using "First" for step 5 yields the attributes of dataset A but not dataset B. The attributes for B_points are all null. Please let me know if I am missing something... – user32882 Dec 18 '15 at 5:13
  • I will need to test myself and see what may be missing in the steps. Are you using File, Personal, Enterprise Geodatabase, or shapefiles? I just want to mimic the process accurately. – evv_gis Dec 18 '15 at 14:21
  • @user32882 - I have edited the above after working through the process with file geodatabase feature classes. Although Esri documentation states nulls are ignored, that doesn't appear to be the case. So by adding the A_Point attributes to use FIRST, and B_Point attributes to use LAST, the expected results are created. – evv_gis Dec 18 '15 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.