Skip to main content
Input: Thousands of Lakes; Thousands of Streams

 

 

Ultimately I want to attribute each of the lakes with fields from one stream. There are several streams that intersect each lake. For each lake I want to choose the one stream with the highest HortonOrder and merge the attributes of this chosen stream with the lake.

 

 

So far i've used SpatialFilter to obtain the streams that intersect the lakes. 

 

 

I hope someone can help me figure out the next few transformers needed to achieve what I have described. Many Thanks.
Hi,

 

 

If the Stream features have HortonOrder as a numeric attribute, I would use a SpatialRelator. Lakes -->  BASE Streams --> CANDIDATE Tests to Preform: INTERSECT List Name: _relationships (you can modify it to preferable name)   Output features are Lakes. If an output lake is related spatially with one or more streams, it will have a complex list attribute named _relationships{}. You can sort the list with a ListSorter so that the first element has the highest HortonOrder. Then, extract the first list element (Index = 0) using a ListIndexcer. Extracted attributes will be the required stream's. To learn more about list operations, see related help documentations.   ... but, I'm afraid that there is a case that multiple streams which have same HortonOrder are related to one lake.

 

 

Takashi
Hi Takashi,

 

 

Thank you very much for this information. These transformers work great, when I attach the inspector to the end of the ListIndexer I see all the features have been given the appropriate attributes.

 

 

When I write the ListIndexer output to a shapefile with the same feature type as the initial Lakes, it rejects many of the features and dumps them into a FSS file. 

 

 

Am I missing an intermediate transformer between the ListIndexer and the Writer? Thank you.

 

 

Jackie
For the rejected features I see in the logs 

 

Error - Expected an aggregate or area geometry.

 

 

 


The SpatialRelator transformer has changed some of the lake polygons to polyline features. Is there a transformer I can use to force these to remain polygons so that they will be output?
Just found GeometryCoercer...got it all working!
Hi Jackie,

 

 

Good to hear you got a solution. As far as I know, the SpatialRelator doesn't change geometry of input features. Try checking whether every original Lake (before inputting the SpatialRelator) has polygonal geometry.

 

 

Takashi

Reply