Skip to main content
Dear all,

 

 

I'm wondering if I have misunderstood the SchemaMapper transformer of if it has a bug.

 

 

I'm using it to map any attribute names in a list to another name. However, the Schema Mapper creates every single attribute in this mapping list.... Which I don't want. I just want a mapping.

 

 

The FME Desktop version I use is 2012 SP4 Build 12266 for WIN32 and the Action I selected in the transformer is 'Map Attributes'.

 

 

The following seems to indicate that it is not supposed to create new attributes:

 

 

" when FME finds an attribute whose name is defined in the SourceAttribute column of my CSV file, then it renames it to the name in the corresponding DestinationAttribute column. In this example. if FME finds an attribute called “class” then it gets renamed to “Klasse”" (http://evangelism.safe.com/fmeevangelist41/)

 

 

Thanks in advance,

 

 

Maryse
Hi Maryse,

 

 

if I understand your question correctly, you just want to make a mapping and as a result you don't want to have the Sourc Attribute as well.

 

You can archieve that with the SchemaMapper. In the dialogue when you choose Attribute Mapping you can select the option 'Source Attribute = Remove'. In the resulting dataset you will get just the new Attributes.

 

 

I hope that helps you,

 

best regards,

 

Stefan

 


Hi Stefan,

 

 

Thanks for your reply.

 

 

What I want to do is to use the schema mapper to map attributes from the source dataset to their equivalent name in the csv 'map', but I don't want to keep the other attributes in the csv map which don't exist in the source dataset.

 

 

For instance, if I have the following, what should I get?  - source feature attribute names: a,b,c,d,e,f

 

- csv map: e,1

 

f,2

 

g,3

 

h,4

 

After several tests, that is how the feature attribute names seems to be: - What I expect:: a,b,c,d,1,2

 

- What I get: a,b,c,d,1,2,3,4      <- I don't want 3 and 4! their source equivalents are not amongst the source feature attributes

 

Is there something I didn't get about the SchemaMapper?

 

 

Maryse
Hi Maryse,

 

 

thanks for your explanation. I was able to reproduce the bahaviour you see with SchemaMapper. I wasn't able to get rid of the attribute 3, 4 either... I guess there is no trick to archieve that with SchemaMapper.

 

 

An approach to solve this could be a Python script, that you use after the Schema mapper to eliminate the blank attributes..

 

 

Best regards,

 

Stefan

 

 


Indeed, that's what I have done.

 

 

I used a combination of AttributeExploder, tester, python, AttributeAccumulator, FeatureMerger to get the result I expected.

 

 

I'm sure I've read that the SchemaMapper used its mapping entries as filters...

Reply