Skip to main content
Solved

Filter out lines


nath
Contributor
Forum|alt.badge.img+6
  • Contributor

Hi, This is probably a really simple question. Is there a way to filter out lines which have some attributes in common? For example, i want alle lines who has the same "eindkoppelpunt" and where the attribute is the same, without giving the specific value of the attributes. Is this clear?.

Best answer by david_r

Have you looked at the Matcher?

View original
Did this help you find an answer to your question?

19 replies

david_r
Celebrity
  • Best Answer
  • March 16, 2017

Have you looked at the Matcher?


nath
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • March 16, 2017
david_r wrote:

Have you looked at the Matcher?

thx, that's the one i was searching!

 

 


zzupljanin
Contributor
Forum|alt.badge.img+4
  • Contributor
  • March 17, 2017

Can I ask what is "eindkoppelpunt"? It sounds like endpoint to me...


nath
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • March 17, 2017

It's an endpoint but at the same time it's also an startpoint.


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • March 17, 2017
zzupljanin wrote:

Can I ask what is "eindkoppelpunt"? It sounds like endpoint to me...

Google says: end coupling point which is quite correct...

 

 


nath
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • March 17, 2017

I think the matcher doesn't do exactly what i want. If i have for example 3 different lines with the same endpoint but with 2 times the same "EIG" and 1 different "EIG". The matcher takes the two lines with the same EIG trough the "matched" but if one of the attributes of EIG doesn't match, i don't want that it's a match. I don't know if i'm making any sense :-)


zzupljanin
Contributor
Forum|alt.badge.img+4
  • Contributor
  • March 17, 2017

Then I don't think a Matcher will be enough, since it evaluates entire geometry (not just start/endpoints). If you have a case described in picture bellow.

I believe that first you need to ID the lines (Counter), extract all start and endpoint (Snipper will do the trick), use Matcher on points (with attribute of your choice as well) and use Feature Merger (requestor=Lines, Supplier= Points) to see which lines (with according start/endpoints) are matched (requestor and supplier attribute is _count).

Hope it helps


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • March 17, 2017

Have a look at the CRC calculator its my favourite transformer for change detection.


zzupljanin
Contributor
Forum|alt.badge.img+4
  • Contributor
  • March 17, 2017
nath wrote:

I think the matcher doesn't do exactly what i want. If i have for example 3 different lines with the same endpoint but with 2 times the same "EIG" and 1 different "EIG". The matcher takes the two lines with the same EIG trough the "matched" but if one of the attributes of EIG doesn't match, i don't want that it's a match. I don't know if i'm making any sense :-)

So when 2 or more EIGs match you want to check if all attributes match? Use another Matcher with all attributes checked (or FULL option).

nath
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • March 17, 2017

naamloos.pngcapture.png

I have to give the "koppelpunt" an owner (EIG). I'm only using the lines for their attibutes. If there is only one line that ends on that point then it's easy but in the example ther are 3 lines that ends there. If that happens then i have to determine which one i'm gonna gona use bij giving an order on the attribute EIG, f.e. If there is an EIG = AQF that has priority, second in line is EIG = Gemeente, then EIG = Privé etc...

The lines have an attribute "Eindkoppelpunt" that is the same as the ID of the Koppelpunt.

I have to do the same for the beginpoints of each line, so each koppelpunt has an EIG from the "Beginkoppelpunt" and from the "Eindkoppelpunt".


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • March 17, 2017
nath wrote:

naamloos.pngcapture.png

I have to give the "koppelpunt" an owner (EIG). I'm only using the lines for their attibutes. If there is only one line that ends on that point then it's easy but in the example ther are 3 lines that ends there. If that happens then i have to determine which one i'm gonna gona use bij giving an order on the attribute EIG, f.e. If there is an EIG = AQF that has priority, second in line is EIG = Gemeente, then EIG = Privé etc...

The lines have an attribute "Eindkoppelpunt" that is the same as the ID of the Koppelpunt.

I have to do the same for the beginpoints of each line, so each koppelpunt has an EIG from the "Beginkoppelpunt" and from the "Eindkoppelpunt".

sounds familiar, dealing with BGT bronhouders?

 

 


zzupljanin
Contributor
Forum|alt.badge.img+4
  • Contributor
  • March 17, 2017

I think I understand.

1. Get Eindkoppelpunt: use Splitter (by Vertex: starting and ending vertex -1) this will give you endpoints

2. Use Matcher on Eindkoppelpunt and koppelpunt.

3. From matched port separate Eindkoppelpunt and koppelpunt using AttributeFilter (by fme_feature_type)

4. Use Sorter of endpoints. Sort alphabetical all Eindkoppelpunt (by EIG)

5. Use SpatialFilter. You'll be checking if koppelpunt is same as Eindkoppelpunt (Filter: Eindkoppelpunt, Candidate: koppelpunt, Operation: Equals)

Passed port will give you all koppelpunt with attributes of first Eindkoppelpunt (feel free to remove all but EIG with AttributeRemover).

Repeat the same procedure for Beginkoppelpunt (in Splitter indices are 0)

Hope it helps


nath
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • March 17, 2017
zzupljanin wrote:

I think I understand.

1. Get Eindkoppelpunt: use Splitter (by Vertex: starting and ending vertex -1) this will give you endpoints

2. Use Matcher on Eindkoppelpunt and koppelpunt.

3. From matched port separate Eindkoppelpunt and koppelpunt using AttributeFilter (by fme_feature_type)

4. Use Sorter of endpoints. Sort alphabetical all Eindkoppelpunt (by EIG)

5. Use SpatialFilter. You'll be checking if koppelpunt is same as Eindkoppelpunt (Filter: Eindkoppelpunt, Candidate: koppelpunt, Operation: Equals)

Passed port will give you all koppelpunt with attributes of first Eindkoppelpunt (feel free to remove all but EIG with AttributeRemover).

Repeat the same procedure for Beginkoppelpunt (in Splitter indices are 0)

Hope it helps

Unfortunately, this does not help for two reasons. The first reason is that the "koppelpunten" are not perfect caught at the lines. I have already applied a few snappers to improve this but when I use the "snipper transformer on the lines" he makes extra points so the spatial filter gives troubles. The second reason is that if I sort EIG = gemeente that he may not always puts AQF on top because EIG = actually the code of the municipality.

 

I don't really also understand what you ment with stap 3.

 

 

Thanks for your suggestion.

 

 


zzupljanin
Contributor
Forum|alt.badge.img+4
  • Contributor
  • March 17, 2017
nath wrote:
Unfortunately, this does not help for two reasons. The first reason is that the "koppelpunten" are not perfect caught at the lines. I have already applied a few snappers to improve this but when I use the "snipper transformer on the lines" he makes extra points so the spatial filter gives troubles. The second reason is that if I sort EIG = gemeente that he may not always puts AQF on top because EIG = actually the code of the municipality.

 

I don't really also understand what you ment with stap 3.

 

 

Thanks for your suggestion.

 

 

Interesting. Can you provide some sample data so we can play around a bit?

 

 

Thanks

 

 


nath
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • March 17, 2017

Hi, so give me a way so the result is that for every "koppelpunt" i have the attribute from the EIG from the line that begins with that "koppelpunt" (eig1) and the EIG (eig2) from the line that ends with that koppelpunt. If theres more than one line that end or begins, i want to choose or i want alle the attributes from all the lines on that 1 koppelpunt :-)

Stupid question but how can i provide you sample data ( i have shapefiles)


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • March 17, 2017
nath wrote:

Hi, so give me a way so the result is that for every "koppelpunt" i have the attribute from the EIG from the line that begins with that "koppelpunt" (eig1) and the EIG (eig2) from the line that ends with that koppelpunt. If theres more than one line that end or begins, i want to choose or i want alle the attributes from all the lines on that 1 koppelpunt :-)

Stupid question but how can i provide you sample data ( i have shapefiles)

just zip them and ad them to the message as a file via the message menu

 

 


nath
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • March 17, 2017
itay wrote:
just zip them and ad them to the message as a file via the message menu

 

 

versie8.zip

 

 


zzupljanin
Contributor
Forum|alt.badge.img+4
  • Contributor
  • March 19, 2017

Hi, @nath

I solved your problem. In attachment there's fmw that will do the trick.

By default it gives you alphabetically first EIG. If there are multiple EIGs they are stored in list which is concatenated in attribute _concatenated_EIG. This attribute gives you all EIGs that were matched.

Since you have all data in attributes and you need to merge attributes from one feature to another I used FeatureMerger (no necessity of using Matcher or SpatialFilter). And you've allready said that kokoppelpunts.fmwppelpunten aren't perfectly caught at the lines :)

Hope it helps,

Želimir


nath
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • March 20, 2017
zzupljanin wrote:

Hi, @nath

I solved your problem. In attachment there's fmw that will do the trick.

By default it gives you alphabetically first EIG. If there are multiple EIGs they are stored in list which is concatenated in attribute _concatenated_EIG. This attribute gives you all EIGs that were matched.

Since you have all data in attributes and you need to merge attributes from one feature to another I used FeatureMerger (no necessity of using Matcher or SpatialFilter). And you've allready said that kokoppelpunts.fmwppelpunten aren't perfectly caught at the lines :)

Hope it helps,

Želimir

THANK YOU!

 

I think this is exactly what i needed.

 

 


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