Solved

Attribute search from table to another

  • 8 November 2019
  • 7 replies
  • 1 view

Badge +4

Hi,

I have 2 shapefiles. One file contains road names and another contains locality name. In Road name file the names contain Locality names as well. is there any way I could identify if the names of the locality file. is available in road name file

Please note that the words may not be exact. Here the reference file is locality and the target is road file.

 

Any help is well appreciated.

 

Thanks in advance

icon

Best answer by ebygomm 8 November 2019, 13:54

View original

7 replies

Userlevel 4
Badge +26

You can use the Matcher (turn off geometry and only use the one attribute) - This will only work if the strings match exactly though.

 

 

You can also use a FeatureMerger to join on the name column, however, again it will only match if the string is the same. https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Transformers/Transformers/featuremerger.htm

 

 

You can use operations like CONTAINS and LIKE as you would with ESRIS definition query tool in the join, however, it's not a proper 'search'.

 

 

The FeatureMerger will output features which are not joined which can allow you to build multiple different tests for the same data set.

 

 

Alternatively (depending on the number of features) you might be better just outputting only the unique name values to an excel sheet and create the mapping manually. At the end of the day it could save you hours of trying to figure out a clever method with FME.

 

 

 

 

 

Badge

Provided your road names always begin with a locality name you can use a SubStringExtractor on the roads to pick out the first word (up to the space) and store it as e.g. "roadlocality" and then send that into a FeatureMerger as supplier, with the admin shapefile as requestor. Join on "name" from requestor and "roadlocality" from supplier. Now the admin features that correspond to a road will be output through the Merged port and the rest through the UnmergedRequestor port.

This is a basic way of doing it, if your data are this clean. If the road names can have the location in the middle or the end of the road name you will have to tweak the setup a bit. :)

Userlevel 1
Badge +21

You could use the inlinequerier to find features where the name in the locality file exists in the name of the roadname file

select aa.* from RoadName aa, Locality bb where aa.Streetname like '%'||bb.name||'%'
Badge +4

You could use the inlinequerier to find features where the name in the locality file exists in the name of the roadname file

select aa.* from RoadName aa, Locality bb where aa.Streetname like '%'||bb.name||'%'

Hi @ebygomm,

Thanks a ton for your support. It indeed worked for me. However, there are some records which partly matched. The blank could not match. Any help in this regard is highly appreciated.0684Q00000ArMQnQAN.png

 

Regards,

Mukhtar

 

Badge +4

Hi @ebygomm,

Thanks a ton for your support. It indeed worked for me. However, there are some records which partly matched. The blank could not match. Any help in this regard is highly appreciated.

 

Regards,

Mukhtar

 

Also, the output gives unmatched records also. is there any way it can be removed from the output?

Userlevel 1
Badge +21

Also, the output gives unmatched records also. is there any way it can be removed from the output?

In this scenario, I would probably use a tester on the locality table, and test for attribute has value

Badge +4

In this scenario, I would probably use a tester on the locality table, and test for attribute has value

Hi. I found the bug, somehow the output is creating space in the empty cell.

Reply