Skip to main content
Question

Copy attributevalue

  • March 6, 2013
  • 4 replies
  • 31 views

Forum|alt.badge.img
I have 2 shapefiles (points). How can i copy the attributevalue from shape 1 to shape 2 if the points have the same geometry.

 

Example if point A from shape 1 and point B from shape 2 have the same X,Y and i want to copy an attributevalue from point B point A
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

davideagle
Contributor
Forum|alt.badge.img+22
  • Contributor
  • March 6, 2013
Easiet method is to use the UnconditionalFeatureMerger. However, you could concatenate the X&Y values into a new attribute called ID on both features and then use the FeatureMerger with the ID value as the new primary key.

 

 

Hope that helps

sigtill
Supporter
Forum|alt.badge.img+25
  • Supporter
  • March 6, 2013
Or use the AttributeCreator directly to get the X and Y value and then merge on the ID.

david_r
Celebrity
  • March 7, 2013
Just to add to the excellent answers below: if you're merging based on coordinate values it might be a good idea to add a CoordinateRounder or AttributeRounder on your values before merging.

 

 

Otherwise you risk missing matches based on fractional differences in the floating point string representation, e.g.

 

 

1.9999999997 <> 2.0

 

David

david_r
Celebrity
  • March 7, 2013
By the way, if you need to set a tolerance on your X,Y matching, use a NeigborFinder.

 

 

It enables you to specify a maximum distance (tolerance) between the two datasets and it will automatically merge the attributes on the matching geometries.

 

 

David