Question

How to Dynamically Read and Write Multiple Features?

  • 26 March 2020
  • 4 replies
  • 33 views

I have a folder containing 77 Esri Layer Files. I would like to consume each of these 77 layer files and then write them into SDE.

 

I have a dynamic reader/writer workflow setup. Dynamic Reader is set to read the folder with the features in question, then a Feature Reader, then the Dynamic Writer into SDE.

 

Currently the workbench is attempting to merge features together. I want the workbench to read one feature, dynamically write the feature/schema into SDE, then write the next one, etc.

 

I have tried the WorkspaceRunner without success. Maybe this is an option and I have it misconfigured?


4 replies

Badge +2

@cwchumley You should be able to use WorkspaceRunner. You'll have to split your existing workspace.

Set-up your child workspace first. This will have the Esri Layer reader and SDE writer. It should be able to read one layer file and load your SDE. Make sure the Layer dataset is a published parameter. Test it.

In the parent workspace have your Directory & Filename reader and the workspace runner. When you select the the child workspace in workspace runner, you should see the Layer dataset parameter and you can use the appropriate attribute form the Directory & Filename reader to select the dataset.

More on WorkspaceRunner or batch processing here.

@cwchumley You should be able to use WorkspaceRunner. You'll have to split your existing workspace.

Set-up your child workspace first. This will have the Esri Layer reader and SDE writer. It should be able to read one layer file and load your SDE. Make sure the Layer dataset is a published parameter. Test it.

In the parent workspace have your Directory & Filename reader and the workspace runner. When you select the the child workspace in workspace runner, you should see the Layer dataset parameter and you can use the appropriate attribute form the Directory & Filename reader to select the dataset.

More on WorkspaceRunner or batch processing here.

@markatsafe - Thanks for getting back to me. I think I need some clarification about how I'm making the Layer dataset a published parameter. Take a look at the screenshot I have below.

 

 

LayerFile_Reader is the published parameter set to the Schema Reader.

SourceDataset_SCHEMA is the published parameter from the FeatureReader.

REAL_FORMAT_SCHEMA is the published parameter from the Writer.

 

Here's the Parent workspace config. When I try to run the parent workspace, nothing happens. I get two "successful" runs, but the child workspace doesn't appear to run at all (I'm assuming I'm not passing in the correct parameter).

 

Let me know if anything jumps out at you.

 

Thanks!

 

Badge +2

@markatsafe - Thanks for getting back to me. I think I need some clarification about how I'm making the Layer dataset a published parameter. Take a look at the screenshot I have below.

 

 

LayerFile_Reader is the published parameter set to the Schema Reader.

SourceDataset_SCHEMA is the published parameter from the FeatureReader.

REAL_FORMAT_SCHEMA is the published parameter from the Writer.

 

Here's the Parent workspace config. When I try to run the parent workspace, nothing happens. I get two "successful" runs, but the child workspace doesn't appear to run at all (I'm assuming I'm not passing in the correct parameter).

 

Let me know if anything jumps out at you.

 

Thanks!

 

@cwchumley It looks like your using a schema reader to pass a schema file to the FeatureReader - which then re-reads the schema. You could probably replace the schema reader with a creator.

In the child workspace, replace the Test/* with a single layer file name . It should be configured to read only one layer file.

In the parent workspace, use the Directory and File Pathname reader to read the list of Layer files - which you're doing, and pass the path/name to the workspacerunner as an attribute - probably "path_windows"

@cwchumley It looks like your using a schema reader to pass a schema file to the FeatureReader - which then re-reads the schema. You could probably replace the schema reader with a creator.

In the child workspace, replace the Test/* with a single layer file name . It should be configured to read only one layer file.

In the parent workspace, use the Directory and File Pathname reader to read the list of Layer files - which you're doing, and pass the path/name to the workspacerunner as an attribute - probably "path_windows"

@markatsafe - I am utilizing the Schema reader to circumvent the 32-bit necessity for Esri Layer Files. If I attempt to read a Layer File through the FeatureReader, I get this error.

 

Any thoughts? Using the Schema Reader -> Feature Reader -> Writer workflow, I can successfully read/write a Layer file dynamically. It's just getting it to run on on a range of files.

Reply