Skip to main content
Solved

schemamapper doesn't change field names


hirooimaki
Contributor
Forum|alt.badge.img+3

Hi FME community.

I have a simple task to change Japanese field names in a shapefile to English field names. So I was using SchemaMapper to do this task.

I created a simple csv file which has two columns, old_name and new_name. Then, I used this csv file in the ShemaMapper.

I save the resulted layer as a shapefile. But the shapefile I crated had the exactly same field names as original one. All Japanese field names...

I realized that when I inspect the output with the Inspector, I can see that SchemaMapper actually changed attribute names. Please see an image below.

However, it did't reflect these changes when I save this result as a shapefile. Can someone tell me what I am doing wrong??

Thank you in advance.

Hiroo

Best answer by takashi

Hi @hirooimaki, FME renames the attributes according to the SchemaMapper configuration at run-time, but Workbench won't expose the new attribute names automatically, since Wokbench cannot recognize the new names while creating the workspace. In this case, just change User Attributes names in the writer feature type to the new names manually. It's not essential to expose the new attribute names

Note: Shapefile format doesn't allow attribute names greater than 10 bytes. You cannot define attribute names 11 byte or longer, unfortunately.

An advanced approach.If you create a lookup table for a dynamic schema configuration and add the "old_name" column to the table, you can use the lookup table to configure both dynamic schema (destination schema derived from a lookup table) and the SchemaMapper.See these links to learn more.
View original
Did this help you find an answer to your question?

4 replies

Forum|alt.badge.img+2

Hi @hirooimaki,

On your shapefile writer the dropdown list is showing the attributes it is going to write out. From your image these still display the old names so I suggest you need to go into the writer and change the Attribute Definition under User Attributes to expose the writer to these new attribute names.


takashi
Influencer
  • Best Answer
  • August 27, 2018

Hi @hirooimaki, FME renames the attributes according to the SchemaMapper configuration at run-time, but Workbench won't expose the new attribute names automatically, since Wokbench cannot recognize the new names while creating the workspace. In this case, just change User Attributes names in the writer feature type to the new names manually. It's not essential to expose the new attribute names

Note: Shapefile format doesn't allow attribute names greater than 10 bytes. You cannot define attribute names 11 byte or longer, unfortunately.

An advanced approach.If you create a lookup table for a dynamic schema configuration and add the "old_name" column to the table, you can use the lookup table to configure both dynamic schema (destination schema derived from a lookup table) and the SchemaMapper.See these links to learn more.

hirooimaki
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • August 29, 2018
hollyatsafe wrote:

Hi @hirooimaki,

On your shapefile writer the dropdown list is showing the attributes it is going to write out. From your image these still display the old names so I suggest you need to go into the writer and change the Attribute Definition under User Attributes to expose the writer to these new attribute names.

Thank you so much for your tip, @hollyatsafe. I wanted to this task with a dynamic way, so I followed a way @takashi suggested.

hirooimaki
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • August 29, 2018
takashi wrote:

Hi @hirooimaki, FME renames the attributes according to the SchemaMapper configuration at run-time, but Workbench won't expose the new attribute names automatically, since Wokbench cannot recognize the new names while creating the workspace. In this case, just change User Attributes names in the writer feature type to the new names manually. It's not essential to expose the new attribute names

Note: Shapefile format doesn't allow attribute names greater than 10 bytes. You cannot define attribute names 11 byte or longer, unfortunately.

An advanced approach.If you create a lookup table for a dynamic schema configuration and add the "old_name" column to the table, you can use the lookup table to configure both dynamic schema (destination schema derived from a lookup table) and the SchemaMapper.See these links to learn more.
Thanks @takashi, again. I followed your instruction "Common Table for SchemaMapper and Dynamic Schema" and I somehow could make it work. Now I can rename Japanese field names into English easily.

 

Again, thank you!

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings