Skip to main content
Solved

Attribute search from table to another


mukhtarg
Contributor
Forum|alt.badge.img+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

Best answer by ebygomm

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||'%'
View original
Did this help you find an answer to your question?

7 replies

virtualcitymatt
Celebrity
Forum|alt.badge.img+39

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.

 

 

 

 

 


Forum|alt.badge.img
  • November 8, 2019

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. :)


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • Best Answer
  • November 8, 2019

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||'%'

mukhtarg
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • November 12, 2019
ebygomm wrote:

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

 


mukhtarg
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • November 12, 2019
mukhtarg wrote:

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?


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • November 12, 2019
mukhtarg wrote:

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


mukhtarg
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • November 12, 2019
ebygomm wrote:

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


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