Skip to main content
Hi,

 

I'm trying to check if power lines have been connected together with sequential pylon IDs (VOIDENTIFI). Below you can see the attributes for one of these power lines and that the pylon ID is sequential (apart from the first two "0" & "1" points for some reason, so we'll ignore this issue or just start counting at "1" maybe).Ignoring this minor issue my goal here is to flag up if the pylon id is not + or - one, from the adjoining point on the line. The list below is correct but if one of the pylons had been had been skipped then I would like to flag up this point or line.

 

I am unsure how to deal with attribute values that are changing and each line is a different length too.Any pointers on where to go with this would be greatly appreciated.AdrianAttributes of interest for one polyline example:

 

VOIDENTIFI{0}.VOIDENTIFI (encoded: fme-system) KZ0329H083EVOIDENTIFI{1}.VOIDENTIFI (encoded: fme-system) KZ0329H083EVOIDENTIFI{2}.VOIDENTIFI (encoded: fme-system) KZ0329H082EVOIDENTIFI{3}.VOIDENTIFI (encoded: fme-system) KZ0329H081EVOIDENTIFI{4}.VOIDENTIFI (encoded: fme-system) KZ0329H080EVOIDENTIFI{5}.VOIDENTIFI (encoded: fme-system) KZ0329H079EVOIDENTIFI{6}.VOIDENTIFI (encoded: fme-system) KZ0329H078E..............VOIDENTIFI{86}.VOIDENTIFI (encoded: fme-system) KZ0329H006E

Hi,

Whenever I need to check an attribute value against the previous or next value I use the "Enable Adjacent Feature Attributes" setting in the Attribute creator or manager. I would process the lines as points, making sure they are in the correct sort order that would be used to connect them and just test against the previous value to ensure no gaps/duplicates.

https://knowledge.safe.com/questions/29544/how-to-reference-a-value-in-a-previous-row-in-an-e.html


Are you building the lines earlier in your process, or is your source a polyline with a list of IDs?

 

 

If the former, then @notmyname suggestion of Enable Adjacent Features is the way to go in an attributeCreator to create a sequential flag attribute, which can then be tested for once the line is built.

 

 

If the latter, then you can loop though the list to check if it's sequential. I would do that in python, but it can also be done in a custom transformer with a loop and a listIndexer.

Reply