Skip to main content
Question

Expose unknown Civil Property Sets by prefix - dynamic writer

  • January 14, 2020
  • 6 replies
  • 46 views

jasperwis
Enthusiast
Forum|alt.badge.img+19

Hi,

 

Goal of this workbench was to be able to expose the property sets attributes of a Civil dwg, without knowing the attribute names. I am only interested in the property sets starting with a fixed prefix. I have started from some python code I found here: python attribute names

Topic is related to:

https://knowledge.safe.com/idea/18842/bulkattributeexposer-expose-all-possible-attribute.html

https://knowledge.safe.com/questions/32777/how-to-expose-all-attributes-in-generic-way-any-ma.html

 

Since I don't know the attribute names beforehand, I have to use a dynamic writer.

First I was trying to avoid this, since I am not familiar with the dynamic workflow, so I was writing everything to a json string, so that I was able to write all desired output. But now I am trying to use the dynamic writing functionalities.

I have 2 questions:

1/ the attribute names in the shapefile output are too short (have a length of only 1-3 characters). How can I fix this?

2/ Is it possible to put all exposed attributes into the FME table? The complexity is that I don't know the amount of attributes and the attribute names beforehand, so I cannot use the AttributeCreator. Or is there a way to create attributes based on a list (not having to save the list and importing it back)?

 

Jasper

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • January 14, 2020

Issue 1 is because you cannot create attributes with the names you are trying to create

e.g. it is not possible to create a shapefile attribute with the name LIB - set1.prop1 - the spaces, and characters (- and .) as well as the overall length are all problems here.


jasperwis
Enthusiast
Forum|alt.badge.img+19
  • Author
  • Enthusiast
  • January 15, 2020

Thank you, wasn't aware of this. Field name length limited to 10 characters.

Any idea for issue 2?


ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • January 15, 2020

Thank you, wasn't aware of this. Field name length limited to 10 characters.

Any idea for issue 2?

I'm not sure what you mean by FME table


jasperwis
Enthusiast
Forum|alt.badge.img+19
  • Author
  • Enthusiast
  • January 17, 2020

I'm not sure what you mean by FME table

I mean over here:

or here:

So I can use these attributes in the next steps of the workbench.

If I would know the names and the amount of attributes beforehand, I could add a AttributeCreator before the PythonCaller. But I don't. So basically, I am looking for a way to add these attributes (found in the Python script) to the output port of the PythonCaller.


ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • January 17, 2020

I mean over here:

or here:

So I can use these attributes in the next steps of the workbench.

If I would know the names and the amount of attributes beforehand, I could add a AttributeCreator before the PythonCaller. But I don't. So basically, I am looking for a way to add these attributes (found in the Python script) to the output port of the PythonCaller.

It's not possible to do what you are suggesting. If it is a dynamic workflow there is no need to expose the attributes in the workspace.


jasperwis
Enthusiast
Forum|alt.badge.img+19
  • Author
  • Enthusiast
  • January 20, 2020

It's not possible to do what you are suggesting. If it is a dynamic workflow there is no need to expose the attributes in the workspace.

There is one need in my point of view: using those attributes further one in the workbench in the standard transformers. I catch those values in the pythoncaller, but they stay more or less unexposed.