Solved

SchemaMapper help needed: how to split one feature type into different feature types based on value of an attribute?

  • 22 November 2022
  • 4 replies
  • 50 views

Badge +1

I have read all the SchemaMapper tutorials and implemented what I thought should work for a SchemaMapper and input mapping table, but the feature type in question here is not being mapped at all. I am hopelessly confused, hence the following explanation and question:

 

I have a feature type Safety/Fire (i.e. fme_feature_type = feature_dataset/feature_class) that I want to split into three different feature types based on the value of the Type attribute. The values are FDC, Fire Alarm, and Fire Extinguisher. I also want to put the three new feature types into a different feature dataset, namely Life_Safety. Here is a screenshot of part of the mapping table I am using:

 

image.png 

In the SchemaMapper I have set first a Filter Features action with SRC_FIELD = SRC_FIELD_VALUE indicated and with Ignore Blank Attribute Values set. Then I have a Map Feature Types action with SourceFeatureType --> TargetFeatureType indicated. Finally, I have a Map Attributes action with SRC_FIELD --> TargetAttr indicated. After the SchemaMapper, all features are written out to an existing unpopulated GDB with known schema (the GDB for a GIS Standard, to be precise).

 

So, as I have been understanding (misunderstanding?) how the SchemaMapper works, let's say a Safety/Fire feature with Type=FDC comes through; the SchemaMapper would first scan the table for lines where a value for SRC_FIELD_VALUE is given and where that value is FDC. Doing so, it would find the first line in the screenshot above. Then the SchemaMapper would apply the Map Feature Types action and change the fme_feature_type of the feature to Life_Safety/WaterFireConnectionPoint. Finally, the SchemaMapper would apply the Map Attributes action. Specifically, it would do nothing with Building but then change CreationDate to createDate, Creator to creator, EditDate to lastUpdate, and Editor to editorName; however, the Safety/Fire features are not being mapped at all. I thought maybe the white lines in the screenshot above should instead have the new, mapped feature type under SourceFeatureType, as the feature would now have its feature type changed and wouldn't match the pattern of those white lines. That didn't work either, though.  So, what am I doing wrong or not understanding? 

icon

Best answer by egge 24 November 2022, 15:34

View original

4 replies

Userlevel 1
Badge +11

Hi,

You state that you want to split one feature type into different feature types based on value of an attribute.

Did you have a look at the Fanout option already?

"A fanout is a way within FME to split output data based upon the value of an attribute. The data is divided at the time of writing, rather than within the workspace itself."

HTH,

Egge-Jan

Badge +1

Hi,

You state that you want to split one feature type into different feature types based on value of an attribute.

Did you have a look at the Fanout option already?

"A fanout is a way within FME to split output data based upon the value of an attribute. The data is divided at the time of writing, rather than within the workspace itself."

HTH,

Egge-Jan

@egge​ Thanks for that suggestion. I may be able to construe my situation as a fanout. I have never done a fanout before. It is certainly worth a try, as using the SchemaMapper to do this is still not working, and I am up against a deadline now. I will let you know what happens.

Badge +2

@tcrossman​ I suspect that you need both the schemamapper and the feature type fanout(as suggested by @egge​ ). SchemaMapper is probably renaming your attributes correctly. But then on the fanout, you need to use the attribute as the feature type name in the writer feature type definition - see the dynamic workflow tutorial

Badge +1

@tcrossman​ I suspect that you need both the schemamapper and the feature type fanout(as suggested by @egge​ ). SchemaMapper is probably renaming your attributes correctly. But then on the fanout, you need to use the attribute as the feature type name in the writer feature type definition - see the dynamic workflow tutorial

Thanks, @Mark Stoakes​. I did look into your solution, and that would indeed work efficiently--and slickly, I might add--but, due to my deadline and not being able to figure out the FME in time, I implemented a kludgy but workable data preprocessing step in FME. The fanout part is what I was really missing. If I had to do it over again, I would do it your way.

Reply