How to select attributes which are different for different features?
I have a problem. First my FME:
It is partly in Dutch, but it doesn't matter here. It is about spatial data with some features. There are two feature readers: the first one to select features which fall within a pre-defined contour, the second to select features. The attribute manager to add some attributes. The featurewriter to write the data in gdb format.
In the FeatureReader you can see attributes for “pand_v” and for “scheiding_v”. The attributes of “scheiding_v” are standard, hence the same for other features, except for “pand_v”. The difference is that in “pand_v” BGTPlusType is replaced by “identificatieBAGPND”. The features are of several geometric types: lines, polygons and points.
In the output of FeatureWriter all the attributes as given in the AttributeManager are shown. I'd like to see that for “pand_v” no BGTPlusType is given (there is no value here) and that for all other features no “identificatieBAGPND” is shown. And that some other attributes like fme_…, attribute{}…, etc., are not shown.
To be complete, here is the FeatureWriter:
How can I achieve that?
Page 1 / 1
Hi @sparks If I understand correctly, I think you want to remove attributes from the FeatureWriter ?
You can use the AttribtueKeeper or AttributeRemover in these cases. One might work better for you then the other. Did I understand correctly? I hope this helps.
Hi @sparks ,
You have configured dynamic schema in the FeatureWriter, so attributes you configured in the User Attributes table would be treated as additional attributes other than attributes provided by the schema definition.
Take a look at the User Attributes table, and try removing all rows from the table if any rows exist there.
In addition, you can directly connect the <Schema> port of the FeatureReader and the FeauterWriter if you would configure dynamic schema derived from schema feature.
Hi all,
Thank you for your replies. I’m afraid that I'm understood incorrectly (I'm really bad in explaining the situation, my bad!). Let us focus on one issue I’m trying to solve.
If you look at the attributes of the feature “pand_v” in the FeatureReader in the picture above and notice the attribute “identificatieBAGPND”. That attribute is specific for”pand_v”, other features have not that attribute. Other features have instead of it the attribute “BGTPlusType”.
Now the output (as checked in ArcGIS Pro) is that all the features have the attribute “identificatieBAGPND” which is I don’t want. I only want to see that attribute for the feature “pand_v”, not for other features.
At the other side, I don’t want to see the attribute “BGTPlusType” for the feature “pand_v” as that feature has no attribute “BGTPlusType”.
It seems that the schema is not working well here. Or is there another cause? It would be nice if this can be solved in case of different list of attributes for different features.
In short: for each feature, in the output only the attributes should be shown as given in the attributes list of that feature in the FeatureReader.
Have you checked the User Attributes tab in the FeatureWriter? I suspect that an attribute called “identificatieBAGPND” is defined statically in the User Attributes configuration.
Basically you don’t need to define any User Attributes statically, since you have configured dynamic schema.
This is my User Attributes of the FeatureWriter:
They are standard set to Dynamic because of the Dynamic Schema Definition. I’m sorry, I’m new to FME!
@sparks No need to apologize for trying to explain complex wibbly wobbly workflows I think I got it now. As @takashi dynamic schema should be handling that. But maybe if there are two schemas being read we have to select the one we want? Hope this helps. I still have a lot to learn with dynamic functionality.
"identificatieBAGPND” is defined as a user attribute, it's the reason why it would be a column in the destination schema. Since you have configured dynamic schema, you don’t need to define User Attributes generally, except a case where additional attributes should be defined statically.
Try removing all the rows as I mentioned before.
Hi @crutledge , thank you for the answer. I already have taken a look at the schema definition. However, there is only one to choose: “Schema From Schema Feature”. But thanks anyway!
@takashi , your solution works! Now I’m satisfied about the output! Probably I added the user attributes accidently by choosing the option “Automatic” and then back to “Dynamic”. As I have added two new attributes in the AttributeManager, they did not appear in the output in the first instance. By adding these two attributes in the User Attributes, with the Attribute Definition set to “Dynamic”, now I can see these two features in the output.