Skip to main content
Hi all

 

 

A short introduction to my script so far: I have two readers 

 

 

a. NewsArticle (s stands for source)

 

ID-S   |   Text     |    Country_S     |      Sector_S

 

1.              ...

 

...               ...

 

30             ...

 

 

b. Shapefiles of all different sectors

 

ID-dB   |   Sector_dB  |   Country_dB  |   

 

1.               .... 

 

...              ....

 

30000    .....

 

 

The mail goal is to assign the different Newsarticles to the correct sector (in order to map the news). I am doing this by an inlinequery that Takashi suggested. This query's output are all the articles that are both matched by country as by sector. (lets say 14 out of the 30 articles).

 

 

I would now like to use the rest of the articles (that have not been assigned to a specific sector) to be linked at the country level. I have a shapefile of all the countries.

 

I have come up so far with a query that links all the articles to a country, but I only need the ones that are not yet linked to a sector.

 

 

Is there an easy filter method or even better a query to efficiently do this?

 

Hi again,

 

 

There could be several approach, one possible way is like this. Continuing from my post in the previous Q&A; and assume the NewsArticle features have unique identifier attribute named "ArticleID".

 

  1) Append a column for "ArticleID" to NewsArticle table in the InlineQuerier. Table: NewsArticle:   Columns:     ARTICLE  text     SOURCE  text     ArticleID  <appropriate type>   2) Append another output port to the InlineQuerier, select articles which matches with a country. Output Port: Matched2 SQL Query: ----- select a.fme_feature_content, b.ARTICLE, b.SOURCE, b.ArticleID from Location as a cross join NewsArticle as b where b.SOURCE like '%'||a.COUNTRY||'%' -----   3) Modify SQL for "Matched" port so that "ArticleID" will be added to selected features. ----- select a.fme_feature_content, b.ARTICLE, b.SOURCE, b.ArticleID ... -----   4) Use a FeatureMerger to find target articles. i.e. Matched2 --> REQUESTOR Matched --> SUPPLIER Join On: ArticleID   Then, NOT_MERGED features will be target articles.

 

 

Takashi

Reply