Question

FME error when performing a simple process of adding columns (attributes) to multiple features

  • 23 April 2021
  • 4 replies
  • 20 views

Badge

I've created a workbench where I simply need to add four columns into multiple features. I've tried a few different ways. The data has metadata in it so I just want to truncate the table or drop and create so it retains the metadata.

  • I used a dynamic writer, the error is random.
  • I tried a more manual way by just exporting "Create if needed" into an empty GDB and importing Metadata afterwards. Still no luck. Weird errors.
  • I tried an even more manual way by pushing one feature at a time through and having a non-dynamic output. This was random, sometimes it would work, but sometimes it wouldn't. I finally got this to work and pushed through 20 features before it decided to stop working and error "Cannot write a non-point feature to a point feature class" but the output is set to polygon! I've made several new writers and readers and workbenches, and used different features and new GDB's and I can not get this to work.

 

AjoKY77FbGeVIz9 

 


4 replies

Userlevel 6
Badge +32

I don't understand the part:

The data has metadata in it so I just want to truncate the table or drop and create so it retains the metadata.

  • Not sure what part has metadata.
  • You can't truncate a table AND add columns. Truncate means remove all records from table. FME can't add columns with a writer. (You can python script it, but not use a writer.)

But this should not be difficult. I added a sample workspace doing this without issues.

 

Badge

I don't understand the part:

The data has metadata in it so I just want to truncate the table or drop and create so it retains the metadata.

  • Not sure what part has metadata.
  • You can't truncate a table AND add columns. Truncate means remove all records from table. FME can't add columns with a writer. (You can python script it, but not use a writer.)

But this should not be difficult. I added a sample workspace doing this without issues.

 

The feature classes in the GDB has metadata in it, so I was trying to work out a way to update the columns and retain the metadata.

I'm a little confused by your workbench, would you mind expanding a bit? Do I use all three stages? If so, at what point do I add my attribute manager in?

Userlevel 6
Badge +32

The feature classes in the GDB has metadata in it, so I was trying to work out a way to update the columns and retain the metadata.

I'm a little confused by your workbench, would you mind expanding a bit? Do I use all three stages? If so, at what point do I add my attribute manager in?

To process the data only use the bookmark "Read source, add column, write target." What it does is write dynamic using a schema feature. The schema feature comes from the <Schema> outputport from the FeatureWriter. With classic readers I think you can use the "Schema (Any Format)" reader.

 

Replace the RandomNumberGenerator with the AttributeManager and add the columns in the FeatureWriter, User Attributes tab.

 

In this case though (FeatureClasses have metadata, you only want to add columns) I would use Python. See ESRI's Add Field (Data Management) documentation. Using a PythonCaller in combination with a GDB reader (schema only) you can easily add the columns for the specified featureclasses. Let me know if you need an example.

Badge

Hi kimburrows1242

 

Believe it or not, i had a similar issue which sometimes it was working some others it did not but its not random, in my occasion some dates didnt exist at all. FME is quite smart when dealing with dates checking its won calendar for cross reference. As an example i had a date 31.04.2021 but in reality that date does not exist so the workbench failed me and a could not understand why until i found my problem when i eventually went and check the dates one by one. You can run a formula in excel. i am only mentioning that because i can see the date/time stamper.

Reply