Question

Need explanation how to iterate on the reader


Hello guys,

i would like to iterate on my reader, i have one reader who read the county feature of the state of New York and a other one who read 8 millon of small polygon who are a mix with slope + swamp and forest.

 

 

Well i would like to iterate each county of new york than clip each county by this small polygon and result will be a county with holes and finaly i write all the county with holes in geodatabase. (evry data come from an esri geodatabase)

 

 

I read that i can create a master workbench and child workbench and use workbenchrunner. well i ve seen in this forum a guy who write that "If nothing else works, you could iterate over the input features using a master workspace that runs the clipping workspace using e.g. the WorkspaceRunner. You can there parametrize which block to process using a published parameter. But my tip is to start with the top two recommendations first. " the thing i can not really visualize what he mean, so if somebody can send me schema or picture ?

 

 

I know the basic on fme a Little about published parameter.

 

 

Thank you very much

10 replies

Userlevel 2
Badge +12

The way to do this is:

Create a published parameter for the county (name or id) to limit the workspace to one county.

Create a second workspace with a reader for the counties.

After the reader add a WorkspaceRunner transformer, calling the first workspace.

Set the parameter for the county to use the name from the County reader.

This will loop through the counties, calling the workspace for each one.

Hope this helps.

Badge +22

Have a reader of New York counties. If there isn't a unique id per county, add one with a Counter.

Send that to a featureReader of your swamp/forest data, with a SpatialFilter of Initiator Intersects Result or Bounding Boxes Intersect, and merge attributes.

Send your both sets of data to a clipper with a group by on the unique ID.

The way to do this is:

Create a published parameter for the county (name or id) to limit the workspace to one county.

Create a second workspace with a reader for the counties.

After the reader add a WorkspaceRunner transformer, calling the first workspace.

Set the parameter for the county to use the name from the County reader.

This will loop through the counties, calling the workspace for each one.

Hope this helps.

Than you very much Erik, im sorry im a little bit lost with the published parameter, i dont know how to create this cain of parameter do you know a video or a schema to explain that ? the thing is im french and sometimes i can more understand the images. Ive seen couple of explanation but may be i didnt understand everything

The way to do this is:

Create a published parameter for the county (name or id) to limit the workspace to one county.

Create a second workspace with a reader for the counties.

After the reader add a WorkspaceRunner transformer, calling the first workspace.

Set the parameter for the county to use the name from the County reader.

This will loop through the counties, calling the workspace for each one.

Hope this helps.

Hello @erik_jan can you explain me how to create an published parameter on the attribute ?

 

Userlevel 2
Badge +12

Hello @erik_jan can you explain me how to create an published parameter on the attribute ?

 

Hi @pascalfilippi, this would be a good place to learn about parameters:

https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_QuickTranslator/Workbench/published_private_parameters.htm

Erik

Hello @erik_jan but your link don t work, but thank you

Userlevel 2
Badge +12

Hello @erik_jan but your link don t work, but thank you

Try this link:

https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/!Transformer_Parameters/adding_a_parameter.htm

@erik_jan, Im sorry guy i don"t know if im stupid or may be i don't understand the logic but i still can not find the way to create a user parameter for the value of an attribute, i totaly get it with the run inspector, i try to create in the child workspace an attribute with the where clause but when i run. i send you a picture of what im doing let me know if it good, im in the despair.

 

child workspace

 

 

father workspace

 

when i running the last one the child workspace dont create nothing

Userlevel 2
Badge +12

@erik_jan, Im sorry guy i don"t know if im stupid or may be i don't understand the logic but i still can not find the way to create a user parameter for the value of an attribute, i totaly get it with the run inspector, i try to create in the child workspace an attribute with the where clause but when i run. i send you a picture of what im doing let me know if it good, im in the despair.

 

child workspace

 

 

father workspace

 

when i running the last one the child workspace dont create nothing

In the child workspace the WHERE clause on the table should be something like: COUNTY = '$(COUNTY_NAME)'

COUNTY is the name of the attribute in the table

The COUNTY_NAME is the name of the published parameter

In the parent workspace, the published parameter shows in the WorkspaceRunner and should get the value of the attribute containing the county name.

Hope this helps

In the child workspace the WHERE clause on the table should be something like: COUNTY = '$(COUNTY_NAME)'

COUNTY is the name of the attribute in the table

The COUNTY_NAME is the name of the published parameter

In the parent workspace, the published parameter shows in the WorkspaceRunner and should get the value of the attribute containing the county name.

Hope this helps

Thanks man its work very welll !!!!

Reply