Question

All list elements to attribute from GML to File Geodatabase


I have made a workspace that downloads Dutch TOP100NL via links like these: http://geodata.nationaalgeoregister.nl/top100nl/extract/kaartbladen/TOP100NL_20W.zip?formaat=gml

I read the GML data with a FeatureReader and in the end I write it to a File Geodatabase. However after I ran my entire workspace I saw that I was missing some columns in my Attribute table.

After searching for some time I found that the GML sometimes has multiple value's for the same attribute. As you can see in this screenshot we have two values for 'fysiekVoorkomen'.

 

If this is the case in FME there are two curly brackets behind the attribute and in the end this attribute is not written to the File Geodatabase. This is not only the case with the attribute 'fysiekVoorkomen', but with a lot more attributes in my workspace. Here you see how the attribute is displayed (fysiek...omen{}).

Apparently the curly brackets mean that the attribute consists of multiple elements (listelements). I would like to write this attribute (and all the others) to the file geodatabase. So if 'fysiekVoorkomen' has 2 elements, I would like to have two columns in the end, for example fysiekVoorkomen1 and fysiekVoorkomen2, so I have both values in my file geodatabase.

When I right click on the attribute I can chose to expose elements, but I would like to have all the elements exposed, because otherwise It would take pretty long to expose all the elements manually. Is there a way to do this?


2 replies

Userlevel 2
Badge +17

Hi @tomhhnk,

You can use the BulkAttributeRenamer transformer to rename the list elements to regular attributes:

 

0684Q00000ArKMJQA3.png

 

The '\1' in the replacement string means take the contents of the first set of '()' in the Regex string, which is searching for the number with the '{}' in the list attribute name. The results for:

fysiekVoorkomen{0}
fysiekVoorkomen{1}

would be:

fysiekVoorkomen0
fysiekVoorkomen1

You will still need to add these new attributes to the output GDB feature type definitions, or use the SchemaSetter transformer with dynamic output schemas to generate then automatically.

Hi @daveatsafe thanks for your answer!

I think I understand your solution, but before I use the BulkAttributeRenamer it seems that I first have to rightclick all the listelements to expose all the elements?

I was hoping that there would be an easier way to solve my problem.

Reply