Question

how to merge two data sets with different attributes

  • 11 February 2015
  • 2 replies
  • 3 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

Badge +3
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.)

 

 

 

 
Userlevel 2
Badge +17
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

Reply