I have a simple shapefile (point) that has only ID in the attribute table. I can transform shp to csv but this only gets the ID into the CSV file.

What transformer/settings do I need to read the x,y coordinates of each point in the shapefile and pass them to the CSV writer?


Use the CoordinateExtractor transformer. According to the documentation:

Retrieves the value of the x, y, and z coordinate at the specified index into attributes. A negative index can be used to indicate the position relative to the end of the feature (-1 is the last coordinate, -2 the second last, and so on). The index can be entered as an integer, or may be taken from the value of another attribute by selecting the attribute name from the pull-down list. If the index is invalid, then the translation will be terminated.

If the feature was two-dimensional, then the Z attribute will be given the default value specified.

If the feature was a multi-part feature (aggregate), each part’s coordinates are indexed sequentially.

  • Indeed! Thanks. I knew I had forgotten some trivial things after being away from the program a while! – whatIS Oct 31 '13 at 22:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.