Skip to main content
Question

how to merge two data sets with different attributes

  • February 11, 2015
  • 2 replies
  • 8 views

Hi,

 

 

I have 2 shapefiles with two columns, one is an ID, the other is a description. I need to merge these two datasets into one shapefile whereby if a feature has the same ID but a different description these can get pulled out so I can change them. Sounds simple but for some reason I am really struggling.

 

 

Any advice would be very much appreciated,

 

 

Thanks!

2 replies

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • February 11, 2015
you could use 2 mergers in  a row.

 

1st merges on ID and the second featuremerger uses suplier as wel as requesteroutput from the first featuremeger and merges on ID and Description. Non merged outputs are your target.

 

(or 1st merge on both attributes and the "Not Merged" output to second merger both inputs and merge on ID. Now they Merged ones are the target.)

 

 

 

 

takashi
Influencer
  • February 13, 2015
Hi,

 

 

As Gio suggested, you can use the FeatureMerger to do that.

 

There could also be some other ways. e.g. the InlineQuerier. 

 

 

SQL Query Example:

 

-----

 

select a.*, b.Description as Description2

 

from Shape1 as a inner join Shape2 as b

 

on b.ID = a.ID and b.Description <> a.Description

 

-----

 

 

Takashi

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings