Skip to main content
Solved

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

  • September 1, 2023
  • 3 replies
  • 64 views

urszulacl
Participant
Forum|alt.badge.img

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.

Best answer by nielsgerrits

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2940 replies
  • Best Answer
  • September 1, 2023

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.


urszulacl
Participant
Forum|alt.badge.img
  • Author
  • Participant
  • 1 reply
  • October 26, 2023

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!


adnanyazdani
Contributor
Forum|alt.badge.img+3
  • Contributor
  • 20 replies
  • November 6, 2023

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