Select to view content in your preferred language

extracting field from a feature set

1009
7
Jump to solution
06-28-2013 08:13 AM
NadeemQazi
Regular Contributor
I have following model(attached) which calculates the nearest feature from table B to table. the output table contain TableB_A contains FID, neardist along with other fields. I want to use FID field from contain Table_A to select the feature from TableB. I mean i want to extract all feature from TableB that have fid value equal to fid value in closestTableB_A. I tried join field but it does not work as I also wants to include the shape field from TableB and join field interface does not show me shape field of TableB . in other words it does not allow to include the geometry information of the features in TableB, any guess.
0 Kudos
1 Solution

Accepted Solutions
RichardFairhurst
MVP Honored Contributor
thanks but note that i want to use the value of field TableB_A to find matching records in TableB. the make query  examples uses the hard coded or fixed value. any comment on this....


?  No idea what you are talking about. What do you mean by find matching records?

You said you had done a join, but could not get the shape to be part of it.  Make Query Table will do the join and make the shape part of the output.  Instead of a Join you add both (or even three tables) and define an SQL statement that links the two matching fields you got from the Near Tool and output all of the fields, including the shape field.

Without a table snap shot of any of your actual data, it is hard to guide you beyond saying that the principles of the Make Query Table tool are as flexible as SQL and can handle relationships like TableA_B.FID = Table_B.ObjectID. The only limitation relative to a real join is that you cannot do an outer join where records only in one table are kept in the output.  It only keeps records in the output that match both tables.  But unlike a normal join, it handles one to many and many to many relationships and can preserve the shape from either side of the join (but not from both sides obviously).

View solution in original post

0 Kudos
7 Replies
RichardFairhurst
MVP Honored Contributor
I have following model(attached) which calculates the nearest feature from table B to table. the output table contain TableB_A contains FID, neardist along with other fields. I want to use FID field from contain Table_A to select the feature from TableB. I mean i want to extract all feature from TableB that have fid value equal to fid value in closestTableB_A. I tried join field but it does not work as I also wants to include the shape field from TableB and join field interface does not show me shape field of TableB . in other words it does not allow to include the geometry information of the features in TableB, any guess.


If you put both the table and the original features into the same file geodatabase, then you can use the Make Query Table tool (see also this help).  When set up properly you can deal with the one to many or many to many relationship and export an output that retains the shapes you want.
0 Kudos
NadeemQazi
Regular Contributor
If you put both the table and the original features into the same file geodatabase, then you can use the Make Query Table tool (see also this help).  When set up properly you can deal with the one to many or many to many relationship and export an output that retains the shapes you want.


thanks but note that i want to use the value of field TableB_A to find matching records in TableB. the make query  examples uses the hard coded or fixed value. any comment on this....
0 Kudos
RichardFairhurst
MVP Honored Contributor
thanks but note that i want to use the value of field TableB_A to find matching records in TableB. the make query  examples uses the hard coded or fixed value. any comment on this....


?  No idea what you are talking about. What do you mean by find matching records?

You said you had done a join, but could not get the shape to be part of it.  Make Query Table will do the join and make the shape part of the output.  Instead of a Join you add both (or even three tables) and define an SQL statement that links the two matching fields you got from the Near Tool and output all of the fields, including the shape field.

Without a table snap shot of any of your actual data, it is hard to guide you beyond saying that the principles of the Make Query Table tool are as flexible as SQL and can handle relationships like TableA_B.FID = Table_B.ObjectID. The only limitation relative to a real join is that you cannot do an outer join where records only in one table are kept in the output.  It only keeps records in the output that match both tables.  But unlike a normal join, it handles one to many and many to many relationships and can preserve the shape from either side of the join (but not from both sides obviously).
0 Kudos
NadeemQazi
Regular Contributor
?  No idea what you are talking about. What do you mean by find matching records?

You said you had done a join, but could not get the shape to be part of it.  Make Query Table will do the join and make the shape part of the output.  Instead of a Join you add both (or even three tables) and define an SQL statement that links the two matching fields you got from the Near Tool and output all of the fields, including the shape field.

Without a table snap shot of any of your actual data, it is hard to guide you beyond saying that the principles of the Make Query Table tool are as flexible as SQL and can handle relationships like TableA_B.FID = Table_B.ObjectID. The only limitation relative to a real join is that you cannot do an outer join where records only in one table are kept in the output.  It only keeps records in the output that match both tables.  But unlike a normal join, it handles one to many and many to many relationships and can preserve the shape from either side of the join (but not from both sides obviously).


Thank you after playing with make query table a bit i was able to get what i was trying for .thank you.
0 Kudos
RichardFairhurst
MVP Honored Contributor
Thank you after playing with make query table a bit i was able to get what i was trying for .thank you.


Not even a point and you gave yourself credit for the answer.  That is not the best way to recognize the time others devote to helping you and attracting help for your problems in the future.
0 Kudos
NadeemQazi
Regular Contributor
Not even a point and you gave yourself credit for the answer.  That is not the best way to recognize the time others devote to helping you and attracting help for your problems in the future.


I am really very sorry , I do not know how the points are earned. i clicked the last answer by you as the one who helped me. I really appreciate your effort and sorry about this misunderstanding.
0 Kudos
RichardFairhurst
MVP Honored Contributor
I am really very sorry , I do not know how the points are earned. i clicked the last answer by you as the one who helped me. I really appreciate your effort and sorry about this misunderstanding.


You can put an answer check on any post, it does not have to be the last post (one of my posts would have my user name next to it on the far left).  For points, in one of my posts on the right hand side in the same place above where you would place a check mark to mark an answer is a number with a blue arrowhead above it pointing up.  Click the up arrowhead to assign a point.  The ghosted arrowhead below the number is to retract a point.
0 Kudos