I am converting dwg blocks to Postgres. There are many dwg blocks, and I am writing each block to different tables. In my dwg blocks, there are attributes like fme_attrib_info{1}.field_name and fme_attrib_info{1}.field_value in my output or writer The field name should become attribute name (field name), and the value is from fme_attrib_info{1}.field_value dynamically. Field names are not constant in my input DWG files. What I need is column name, which comes from the fme attribute. Is this possible? pls help me.
I think you can do this using a dynamic workflow combined with the SchemaScanner transformer.
I think you can do this using a dynamic workflow combined with the SchemaScanner transformer.
@nielsgerrits thanks for your reply. Schema scanner ,how to pass attribute as column name. Do you have any sample fmw file?
@nielsgerrits thanks for your reply. Schema scanner ,how to pass attribute as column name. Do you have any sample fmw file?
- Read dwg, do not explode blocks.
- Generate ID for each item.
- Expose the lists fme_attrib_info{}.field_name and fme_attrib_info{}.field_value.
- Explode list fme_attrib_info{} to features.
- Create attributes from field_name and field_value.
- Merge different rows into one based on ID.
- Merge created attributes to original feature using ID.
- Use SchemaScanner to create Schema Feature for each autocad_block_name with attributes as in data.
- Use FeatureWriter to write dynamic based on Schema Feature.
@nielsgerrits thanks for your reply. Schema scanner ,how to pass attribute as column name. Do you have any sample fmw file?
Be aware, writing to PostGIS will probably result to geometry type generic. This is caused by an existing issue where specific geometry type (point / line / polygon) will be mapped to generic geometry.