Question

Find intersecting lines that have different attribute values

  • 23 July 2013
  • 6 replies
  • 19 views

Badge +5

I know there's a "group by" for the Line on Line Overlayer and the Spatial Filter, but what I really want is a "not grouped by".

 

 

That is, how do I only find intersects of lines that have different values for the attribute I'm interested in?

 

 

The particular case I'm looking at is a bunch of lines that have an attribute that identifies them as part of a network. I only want to find where two networks intersect, not where all the lines intersect lines of the same network.

 

 

Lists seem really memory-consuming when there are lots of features, so I'm wondering if there's a more obvious solution.

6 replies

Userlevel 2
Badge +17
Hi,

 

 

It's an interesting subject.

 

Assume every line has an attribute named 'network_id', the following process could be considered, for example: 1) Create intersections of all lines, and collect attributes of associated lines as a list. (LineOnLineOverlayer). 2) Extract minimum / maximum network_id in the list. (ListRangeExtractor) 3) Select only points whose min network_id is different from the max network_id. (Tester).

 

  Use of a list is not likely to be avoided, but I think it's not so inefficient if the list will not be exploded. Hope more efficient solutions will be provided by somebody.

 

  Takashi
Userlevel 4
Hi,

 

 

here is an alternative approach: send your data to a TopologyBuilder with a Group By on the key attribute. Also send your data to another TopologyBuilder without a Group By attribute. You can then send both these results into a Matcher to find the differences.

 

 

David
Userlevel 2
Badge +17
Hi,

 

 

David's approach is a skillful usage of FME geometric operations. Just be aware that when lines belonging to the same network intersect each other, the intersection point might be treated as an intersection in the same network even if a line belonging to other network is also intersected at the same point.

 

 

Takashi
Badge +3
I tried it out with some randomly created connected networks wich i randomly shift as to have em cross eachother (using affiner). Ik give those an net_id.

 

Then created random networks and lines with no net_id.

 

 

Line on line without group by only creates intersection points on the intersections of different nets, not within the net where it crosses itself.

 

 

no list required.

 

 

On the other hadn if the net is a collection of lines (2vertices a piece), it will of course also intersect lines form the same net as they are seperate entities.

 

Wich sugggests that if u do not want to use a group by, u need to temporarely, or just for the sake of the desired result, connect lines form a network. If this yeilds a net with multi polylines, u can consider to give the "subnets" an temp_id and then do the line on line.

 

this is for polylines basically.

 

 

ad hoc:

 

I found also, as i use a custom to generate the nets, that if u do a point on line after the line on line and using the points form lin on line and the original lines, u get a hidden attribute  called (in my case) 1Loop to NetcreateRandom_3_next Input Splitter.BranchingFactory.Count

 

This is 1 netcreator representing 1 net. so if u have a line connecting to more nets u'll get something like:

 

Loop to NetcreateRandom_2_next Input Splitter.BranchingFactory.Count

 

Loop to NetcreateRandom_3_next Input Splitter.BranchingFactory.Count

 

Loop to NetcreateRandom_7_next Input Splitter.BranchingFactory.Count

 

 

where the number represent a net_id.

 

IT seem u can flow (count and loop it into a custom) a net tru a custom (dummy type, dont need to do anything) to get this hidden attribute.

 

 

 

alas... i have no idea how to expose these dynamicaly....:(

 

...not realy a solution, but food for thought on one maybe?

 

 

all other solutions make u use a list...with or witout grouping.

 

 

Badge +5
Thanks for the good suggestions.  

 

 

I ended up using the line on line overlayer with a list and using the range extractor on the point features coming out of the line on line overlayer.  I had about 700 aggregate polylines (one per network) that deaggregated into about 400,000 lines when they went through the overlayer.  It ran efficiently and was done in just a few minutes.

 

 

By contrast, I set up the topology builder/matcher to see how it would go and on the same dataset it's still running after 45 minutes.  So for my data it's not as efficient.  
Badge +5
I should add, I noticed in the Spatial Relator transformer that there's a "Attributes that must differ" parameter.

 

 

But, with my data, I couldn't get anything out of it in under an hour.

Reply