Skip to main content
Question

Python getAllAttributeNames - order?

  • November 21, 2018
  • 5 replies
  • 17 views

ebygomm
Influencer
Forum|alt.badge.img+31

What controls the order that attribute names are listed when using feature.getAllAttributeNames ?

5 replies

mark2atsafe
Safer
Forum|alt.badge.img+43
  • Safer
  • November 21, 2018

Would getSequencedAttributeNames do what you need?

"This method gets a list of sequenced attribute names in the order they were added to the feature."

ebygomm
Influencer
Forum|alt.badge.img+31
  • Author
  • Influencer
  • November 21, 2018
mark2atsafe wrote:

Would getSequencedAttributeNames do what you need?

"This method gets a list of sequenced attribute names in the order they were added to the feature."

I think I have to have a schema to start with to use this, I'm trying to create a dynamic schema to use in a writer


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • November 21, 2018
ebygomm wrote:

I think I have to have a schema to start with to use this, I'm trying to create a dynamic schema to use in a writer

Hi @egomm,

You can get a list of the attribute names on a feature without Python, using the AttributeExploder. This might be more useful for creating a schema feature.


ebygomm
Influencer
Forum|alt.badge.img+31
  • Author
  • Influencer
  • November 21, 2018
daveatsafe wrote:

Hi @egomm,

You can get a list of the attribute names on a feature without Python, using the AttributeExploder. This might be more useful for creating a schema feature.

I can create the schema dynamically in python, i was just curious as I couldn't decipher what logic was being used to control the order of feature.getAllAttributeNames


takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • November 21, 2018

I think that it depends on the implementation. If the name/value pairs of attributes was implemented with the Python dictionary and the getAllAttributeNames method would just return the list of its keys, the order would be unpredictable.


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