Skip to main content
Question

Comparing two datasets and find matching features


mariaka
Contributor
Forum|alt.badge.img+13

Hi there,

Input data:

  1. list with numerous entries, sorted, with changing name
    excerpt:
    name from to
    947606 2041.020 2045.574
    947606 2045.574 2055.574
    947606 2055.574 2065.574
    947606 2065.574 2079.880
    947606 2079.880 2083.168
    947606 2083.168 2089.880
    947606 2089.880 2099.880
  2. list with ‘exceptions’
    excerpt:
    name from to
    947606 108.459 108.747
    947606 2070.204 2074.543
    947606 6071.987 6100

Goal:
I need to find ‘matching’ rows, where from(1) <= from(2) AND to(1) >= to(2) [colored lines].

What I already tried:
I already attached the second list as an list attribute to every single line to the first list (FeatureMerger) and than tried to find the matching line with two ListSearchers. This is limited as the ListSearcher only finds “First ...”.

Can somebody help?

3 replies

dbaldacchino1
Enthusiast
Forum|alt.badge.img+13

Could you post a workspace with some sample data? Might make it easier to give some suggestions. Would be helpful to see the data structure as it sounds like it might be better to explode the lists into features and process with the needed logic, then re-make the lists if needed.


arenscott
Contributor
Forum|alt.badge.img+8
  • Contributor
  • June 3, 2025

Are you looking for an exact match between the two datasets? I might consider concatenating the attributes, on both tables, then using the FuzzyStringComparer, it will produce a figure telling you how good the match is.


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • June 4, 2025

I would use an InlineQuerier for this after exploding the lists

Select t1.*,t2.csv_line_number as matched_t2_line 
from 
"Table1" t1,
"Table2" t2
where 
t1."from"<=t2."from" and 
t1."to" >=t2."to"

This will give you the matched row from the first table, and the line number of the matching row from the second table. 

 

If I didn’t want to explode the lists, I’d always resort to working with python as FME is fairly limited with working with lists


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