How To: Export coordinates of polygon vertices to a TXT file
ArcGIS provides tools to convert the data of a shapefile to text file format, such as TXT. Data converted to a text file can be opened with a text editor.
The instructions provided describe how to export coordinates of polygon vertices to a TXT file.
Two different methods are discussed here. Option A allows users to select which fields to be exported and how the data is separated in the output file. For Option B, the output file automatically includes all fields and uses a comma as the separator.
Note: The Feature Vertices To Points tool requires an ArcGIS for Desktop Advanced license.
- Open the Feature Vertices To Points tool by navigating to Data Management Tools > Features > Feature Vertices To Points.
- Select a layer containing the polygon feature class as the input feature.
- Specify the name of the output feature class and location.
- Select ALL for the Point Type parameter.
- Click OK to run the tool.
This converts the vertices to points and creates a feature class containing points generated from specified vertices or locations of the polygon feature.
- To add XY coordinates to the points, navigate to Data Management Tools > Features > Add XY Coordinates.
- Select the output from Step 1 as the input feature.
- Click OK to run the tool. The XY coordinates of the feature are generated in the attribute table.
- Open the Export Feature Attribute To ASCII tool by navigating to Spatial Statistics Tools > Utilities > Export Feature Attribute to ASCII.
- Select the output from Step 2 as the input feature class.
- Select the values to export to an ASCII text file.
- Select a delimiter to specify how feature coordinates and attribute values are separated in the output ASCII file.
- Specify the name of the output feature class and location. Add '.txt' at the end of the output file name.
- Click OK to run the tool. The coordinates of the polygon vertices are exported to a TXT file.
Note: Check the Add Field Names to Output check box to include the field names included in the output text file.
- Follow Step 1 and Step 2 from Option A. above.
- Open the attribute table of the output from Step 1.
- Click Table Options > Export.
- Click the Browse button to specify the output file name and location.
- Select 'Text file' as the type of the output file, and click Save.
- Click OK.
Note: The output file automatically includes all fields and uses a comma as the separator.
- ArcGIS Help: Feature Vertices To Points
- ArcGIS Help: Export Feature Attribute To ASCII
- ArcGIS Help: Exporting tables