Skip to main content
Dear community,

 

 

I have a dataset with various attributes, which I would like to write to a MapInfo TAB.

 

 

The structure of one feature is as follows (besides other, non relevant attributes for the moment):

 

 

- attribute1 (always has a value)

 

- attribute2 (has mostly a value)

 

- attribute3 (rarely has a value)

 

- attribute4 (is mostly empty)

 

- attribute5 (is nearly always empty)

 

 

I would like to copy the feature (with the geomtry) so that it overlaps. For example:

 

 

If attribute1, attribute2 and attribute3 are present, then there should be a total of three features overlapping, each of them with just one attribute of the list. So feature1 with attribute1, feature2 with attribute2 and feature3 with attribute3. These three resulting features should have the same geometry, but each of them only with one attribute. If in this case, attribute4 and attribute5 are empty or missing, they should not be copied to a feature.

 

 

Any one has an idea how I can accomplish this? Perhaps it's simple for the FME, but I don't see a quick solution at the moment.

 

 

Kind regards

 

Thomas
There are a few ways that you can do this and here is one way

 

 

Since you are only dealing with a few attributes, I would just use an attributekeeper to keep those few. Then use an attributeexploder (may sure to set keep geometry = Yes). Now you will have a cloned feature with only a couple of attributes . Now you should test _attr_value attribute to see something is actually in it.

 

 

Next you want to create the attribute name and attribute value as they came in. So use an attribute creator and set the attribute value to _attr_name (as below...e.g. not Select Attribute)

 

 

You can then remove _attr_name and _attr_value.

 

 


Hi Thomas,

 

I think I would use a List in this scenario. Once you have a list of the attributes then the ListExploder will create the features very easily.

 

 

The question is how to create the list. I think this depends very much on whether Attributes1-5 are a unique combination for every feature. If so, then use the Aggregator transformer and group-by set to those five attributes.

 

 

However, if the combination of attribute values may be repeated on several features, then that won't work. In that scenario I would be tempted to try the ListPopulator. Assuming the attributes really are called attribute1, attribute2, etc - you can use the expression "attr" in the ListPopulator.

 

 

It may be that one of these methods works but provides a feature for all attributes, regardless of whether they existed/had a value. In that case the Tester or NullAttributeMapper should help you sort out the data.

 

 

I hope this helps,

 

 

Regards

 

 

Mark

 

 

Mark Ireland

 

Product Evangelist

 

Safe Software Inc

Reply