Solved

Is it possible to create a workspace that automatically updates the schema table (attribute table) every time it runs?

  • 1 September 2023
  • 3 replies
  • 8 views

Badge

I created a workspace that takes a zip file (nested zip), unzips it to a temporary folder (I used StartUp Python Script to do so). It then reads all the unzipped SHP files from the temporary folder (uses dynamic ESRI Shapefile Reader), reprojects all the files, filters them by feature type (to points, lines, polygons), checks for duplicate features and if the geometry is valid. Finally, it saves 3 output shapefiles:

1. all point elements consolidate into one output shapefile

2. all linear elements consolidate to one output shapefile 

3. all polygon elements consolidate into one output shapefile

 

I would like the workspace to be independent of the input dataset (attributes). Because now when I run workspace with a second set of zipped shapefiles (with different attributes), I get shapefiles in the output with empty attributes that are in the first set of data. 

For example first dataset (which was used to create workspace) has ‘A’, ‘B’, ‘C’ attributes, second dataset has ‘D’, ‘E’, ‘F’, ‘G’ attributes. After running workspace with the 2nd dataset as an output result I got a consolidated  shapefiles with null (missing) ‘A’, ‘B’, ‘C’ attributes. And I would like to get consolidated shapefiles with ‘D’, ‘E’, ‘F’, ‘G’ attributes as an output result.

 

I would appreciate any tips.

icon

Best answer by nielsgerrits 1 September 2023, 17:49

View original

3 replies

Userlevel 6
Badge +33

One way to solve this is to use the SchemaScanner, then feed the SchemaFeature and the DataFeatures into the FeatureWriter, and set that to dynamic.

Badge

Sorry to respond so late, but I was only able to get back to this project now.

Yes, SchemaScanner is what I missed! I implemented it into my workbench and now everything works as I intended.

Thank you!

Sorry to respond so late, but I was only able to get back to this project now.

Yes, SchemaScanner is what I missed! I implemented it into my workbench and now everything works as I intended.

Thank you!

@urszulacl​ 

 

Can you please share your Workspace Template .

I have similar kind but with GDB.

 

I want to refer your approach

 I shall be thankful to you

Thank You

 

Reply