Skip to main content
Solved

Create and populate attribute for 20 datasets?

  • February 5, 2020
  • 10 replies
  • 17 views

lambertus
Enthusiast
Forum|alt.badge.img+23

Hi guys,

I have a small question which could probably be solved easily.

I have 20 datasets. Each of these datasets needs to be given a new field called 'Trajectnaam'. This was done using 20 attribute creators.. this could be done easier I guess?

This field needs to get the name of the corresponding dataset as value for each dataset respectively. Is there an option to enter the name of each dataset as new attribute value?

Finally I want to merge the 20 datasets into 1 dataset with 20 lines.

Thanks for your help!

Best answer by ebygomm

If you expose the fme_dataset attribute on your input datasets you can use this as the value for Trajectnaam.

What format are you reading from?

 

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.

10 replies

redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3700 replies
  • February 5, 2020

Create an Excel file with the filename and Trajectnaam and join that to your data using a DatabaseJoiner or FeatureMerger.


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • Best Answer
  • February 5, 2020

If you expose the fme_dataset attribute on your input datasets you can use this as the value for Trajectnaam.

What format are you reading from?

 


lambertus
Enthusiast
Forum|alt.badge.img+23
  • Author
  • Enthusiast
  • 141 replies
  • February 5, 2020

If you expose the fme_dataset attribute on your input datasets you can use this as the value for Trajectnaam.

What format are you reading from?

 

Input format is a ESRI file gdb, I will try your suggestion.


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • February 5, 2020

Input format is a ESRI file gdb, I will try your suggestion.

If you are reading from a single gdb, and you want the featureclass name to be populated into Trajectnaam you will need to expose the fme_feature_type, not the dataset. If you add the gdb and choose to add a single merged feature type this will be exposed automatically


lambertus
Enthusiast
Forum|alt.badge.img+23
  • Author
  • Enthusiast
  • 141 replies
  • February 5, 2020

If you are reading from a single gdb, and you want the featureclass name to be populated into Trajectnaam you will need to expose the fme_feature_type, not the dataset. If you add the gdb and choose to add a single merged feature type this will be exposed automatically

Could you maybe post a screenshot where I can find the fme_feature_type?


lambertus
Enthusiast
Forum|alt.badge.img+23
  • Author
  • Enthusiast
  • 141 replies
  • February 5, 2020

Create an Excel file with the filename and Trajectnaam and join that to your data using a DatabaseJoiner or FeatureMerger.

This seems to be a bit time consuming, because my dataset names are already in my workbench. The only step I need to do is to acces them and connect a Trajectnaam to them.


redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3700 replies
  • February 5, 2020

This seems to be a bit time consuming, because my dataset names are already in my workbench. The only step I need to do is to acces them and connect a Trajectnaam to them.

You could also try an AttributeValueMapper and have that import the unique values from a source dataset. Or... use FME to generate a list and save that in Excel, then edit that Excel file to suit your needs.


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • February 5, 2020

Could you maybe post a screenshot where I can find the fme_feature_type?

If you click on the cog, then go into format attributes you can select it here

You could also just add an attributeexposer and type in fme_feature_type

 


Forum|alt.badge.img+2
  • 1891 replies
  • February 5, 2020

@lambertus In addition to using the fme_feature_type to set your Trajectnaam attribute, you can probably simplify your workspace by using a dynamic workflow pattern in workbench.

With your current configuration, if your source File geodb changes, i.e. a new feature class is added, then you'll have to update your workspace. If this isn't likely to occur, then you don't need to read any further. However, if the source data might change then you can look at using the dynamic workflow patterns in FME. There's a tutorial on this if you want to explore it further: Tutorial: Dynamic Workflows

You might also benefit from a dynamic workflow pattern on your output.


lambertus
Enthusiast
Forum|alt.badge.img+23
  • Author
  • Enthusiast
  • 141 replies
  • February 14, 2020

If you click on the cog, then go into format attributes you can select it here

You could also just add an attributeexposer and type in fme_feature_type

 

Ah, thanks! I found a solution in the meantime. But still this is useful info :)