Skip to main content
Question

Keep only one attribute (published parameter) renamed in a shape?


Forum|alt.badge.img

I would like my script to keep only one attribute designated by the user in a shape in which it will be renamed. I created the workspace below.

 

 

the attribute "ATTRIBUTE" persists in keeping the value 0 while the selected attribute contains 5, 12, 8, 45 ....

 

Where can my mistake be?

 

 

Thank you

3 replies

jdh
Contributor
Forum|alt.badge.img+36
  • Contributor
  • July 4, 2019

You are setting the new Attribute to the name of the attribute being kept, and since the shapefile writer is expecting a numeric value, it defaults to 0.

 

 

You need to either use @Value($(KEEP_ATTRS)) or use an AttributeDereferencer transformer instead.

jdh
Contributor
Forum|alt.badge.img+36
  • Contributor
  • July 4, 2019
jdh wrote:

You are setting the new Attribute to the name of the attribute being kept, and since the shapefile writer is expecting a numeric value, it defaults to 0.

 

 

You need to either use @Value($(KEEP_ATTRS)) or use an AttributeDereferencer transformer instead.

Note that neither will work as expected if you select more than one attribute to keep


alc33
Contributor
Forum|alt.badge.img+10
  • Contributor
  • July 4, 2019

Hi!

If I well understand your question, you can connect reader to writer directly and create your attribute on "user attributes". Manual mode. You delete the others fields and create a new one called "ATTRIBUTE" with value = $(KEEP_ATTRS)

If you put "5, 12, 8, 45 " on the published parameter, you need to have a type = character.


Reply


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