Skip to main content

Hello,

I have a shapefile with approximately 200 tiles that contains an attribute value for each (e.g. 52A, 52B...). I am trying to output the data where each individual tile or attribute is applied with a SpatialFilter (contains and touches). The only way I know going about it is by using a Tester and changing the values manually each time I run the workspace. I know a loop can be applied to the workspace but I couldn't find any guidance or documentation on dealing with this.

Thank you,

Hi @joeli, Loop can be implemented in a custom transformer, but I don't think the loop is a suitable solution in this case. Probably you can use the SpatialRelator and ListExploder to get your required result by running the workspace just once.

  1. SpatialRelator: Send the current Candidate features (TileSample [shape] -2) to the Requestor port, send the current Filter features (TileSample [shape] -1) to the Supplier port after renaming their Tile_Name to Tile_Name2.
  2. ListExploder: Connect a ListExploder to the Output port of the SpatialRelator, and select "_relationships{}" for the List Attribute parameter. This duplicates the Requestor feature by the number of spatially related Supplier features.

The writer feature type will write the features into different feature types depending on the Tile_Name2 value, since you have set the attribute to the feature type name.


I'm with Takashi here - I don't think a loop is the best way.

It looks to me that you want to match tiles in the two datasets, but only where there is a matching attribute. In that case, can you simply set a Group-By in the SpatialFilter? Does that produce the result you want? Otherwise, again, I'm with Takashi that a ListExploder is probably the way to go.


Thank you for the quick response! I've used @takashi method and it worked out perfectly.


Reply