Skip to main content
Solved

Create and populate attribute for 20 datasets?


lambertus
Enthusiast
Forum|alt.badge.img+12

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?

 

View original
Did this help you find an answer to your question?

10 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

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+32
  • Influencer
  • 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+12
  • Author
  • Enthusiast
  • February 5, 2020
ebygomm wrote:

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+32
  • Influencer
  • February 5, 2020
lambertus wrote:

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+12
  • Author
  • Enthusiast
  • February 5, 2020
ebygomm wrote:

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+12
  • Author
  • Enthusiast
  • February 5, 2020
redgeographics wrote:

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+49
lambertus wrote:

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+32
  • Influencer
  • February 5, 2020
lambertus wrote:

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
  • 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+12
  • Author
  • Enthusiast
  • February 14, 2020
ebygomm wrote:

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 :)


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings