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?
1 Answer 1
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– whatIS2013年10月31日 22:43:53 +00:00Commented Oct 31, 2013 at 22:43