Sign up ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I've got about a dozen polygons in a feature class loaded in ArcMap 10, all in geographic WGS 1984.

How do I easily obtain the coordinates associated with each vertex of each polygon in that feature class?

Ideally I would like them to be nicely tabulated in spreadsheet format.

share|improve this question

8 Answers 8

up vote 18 down vote accepted

Use the "Feature Vertices To Points" tool within ArcToolbox or if you do not have ArcInfo license then you could use the Polygon to Point tool from ET Geowizard (free tool), then in ArcMap you can use the "Add XY Coordinates" tool to get the XY value for each vertex.

share|improve this answer

This works with a standard ArcGIS license:

desc = arcpy.Describe(fcl)
shapefieldname = desc.ShapeFieldName

gebieden = arcpy.UpdateCursor(fcl)

for gebied in gebieden:
    polygoon = gebied.getValue(shapefieldname)
    for punten in polygoon:
        for punt in punten:
            print punt.X, punt.Y
share|improve this answer

Try the geo-wizard tools fron Spatial technologies. It has several free tools that can do what you want. Try the get polygon coordinates. Or polygon to points

et geo-wizards

share|improve this answer

See Bounding Containers using the extent option, it will give you the left, right, top and bottom coordinates of each feature if using the "extent" option. You will have to reassemble into the four points and tabulate into a spreadsheet format (nothing does exactly what you want without some work :) )

share|improve this answer
Thanks for the answer, but the new polygons that tool creates doesn't seem to get me closer to what I need. Not to mention some of my polygons have many sides/corners, and are rotated, which the tool does not seem to consider. Any other ideas? – hpy May 9 '11 at 4:26
@penyuan You probably want to use the word "vertex" instead of "corner" then. – whuber May 9 '11 at 4:36
@whuber: Changed, thanks! – hpy May 9 '11 at 4:45

The following python script (which requires ArcGIS 10.1 or later) utilizes arcpy.da to take a shapefile as an input and create a spreadsheet with an entry for each vertex in each polygon present in the .shp (and I believe it works with lower level arcgis licenses). Object and sequence id's tie the points back to a specific position in a specific polygon.

H/t to @PaulSmith in this post: Get all the points of a polyline for highlighting the explode_to_points option in the arcpy.da.FeatureClassToNumPyArray tool

import os
import csv
import arcpy
from os import path
from arcpy import da
from arcpy import env

env.overwriteOutput = True
env.workspace = '/folder/containing/your/shp/here'

polygon_shp = path.join(env.workspace, 'your_shapefile_name.shp')
vertex_csv_path = 'your/csv/path/here/poly_vertex.csv'

def getPolygonCoordinates(fc):
    """For each polygon geometry in a shapefile get the sequence number and
    and coordinates of each vertex and tie it to the OID of its corresponding

    vtx_dict = {}
    s_fields = ['OID@', 'Shape@XY']
    pt_array = da.FeatureClassToNumPyArray(polygon_shp, s_fields, 

    for oid, xy in pt_array:
        xy_tup = tuple(xy)
        if oid not in vtx_dict:
            vtx_dict[oid] = [xy_tup]
        # this clause ensures that the first/last point which is listed
        # twice only appears in the list once
        elif xy_tup not in vtx_dict[oid]:

    vtx_sheet = []
    for oid, vtx_list in vtx_dict.iteritems():
        for i, vtx in enumerate(vtx_list):
            vtx_sheet.append((oid, i, vtx[0], vtx[1]))


def writeVerticesToCsv(vtx_sheet):
    """Write polygon vertex information to csv"""

    header = (
        'oid',          'sequence_id', 
        'x_coordinate', 'y_coordinate')

    with open(vertex_csv_path, 'wb') as vtx_csv:
        vtx_writer = csv.writer(vtx_csv)

        for row in vtx_sheet:


I also wrote a script that specifically addresses the requirements of: Insert vertices coordinates in polygon which is marked as duplicate to this question, that code is below:

import os
import arcpy
from os import path
from arcpy import da
from arcpy import env
from arcpy import management

env.overwriteOutput = True
env.workspace = '/folder/containing/your/shp/here'

polygon_shp = path.join(env.workspace, 'your_shapefile_name.shp')
file_gdb = 'your/file/gdb/path/here/temp.gdb'

def addVerticesAsAttributes(fc):
    """Add the x,y coordinates of vertices as attributes to corresponding 
    features.  The coordinates will be in the order the appear in the geometry"""

    polygon_copy = createGdbFcCopy(fc)

    vtx_dict = {}
    s_fields = ['OID@', 'Shape@XY']
    pt_array = da.FeatureClassToNumPyArray(polygon_copy, s_fields, 

    for oid, xy in pt_array:
        xy_tup = tuple(xy)
        if oid not in vtx_dict:
            vtx_dict[oid] = [xy_tup]
        # this clause ensures that the first/last point which is listed
        # twice only appears in the list once
        elif xy_tup not in vtx_dict[oid]:

    # find that largest number of points that exist within a polygon to determine 
    # the number of fields that need to be added to the shapefile
    max_vertices = 0
    for vtx_list in vtx_dict.values():
        if len(vtx_list) > max_vertices:
            max_vertices = len(vtx_list)

    xy_fields = addXyFields(polygon_copy, max_vertices)

    u_fields = ['OID@'] + xy_fields
    with da.UpdateCursor(polygon_copy, u_fields) as cursor:
        oid_ix = cursor.fields.index('OID@')
        for row in cursor:
            xy_ix = oid_ix + 1
            for vtx in vtx_dict[row[oid_ix]]:
                for coord in vtx:
                    row[xy_ix] = coord
                    xy_ix += 1


def createGdbFcCopy(fc):
    """Create copy of the input shapefile as a file geodatabase feature class,
    because a huge number of fields may be added to the fc this preferable to shp"""

    if not arcpy.Exists(file_gdb):

    polygon_copy = path.join(file_gdb, 'polygon_shp_copy')
    management.CopyFeatures(polygon_shp, polygon_copy)
    return polygon_copy

def addXyFields(fc, vtx_count):
    """Add fields to the feature class that will hold the x, y coordinates for each
    vertex, the number of fields is twice the number of most vertices in any polygon"""

    field_list = []
    f_type = 'DOUBLE'
    for i in range(1, vtx_count+1):
        f_names = ['x{0}'.format(i), 'y{0}'.format(i)]
        for fn in f_names:
            management.AddField(fc, fn, f_type)


    return field_list

share|improve this answer

So I haven't completed the solution, yet, but it looks like you can use this tool:

Conversion > JSON > Features to JSON.

This will convert your shapefile (in my case 81 polygons) to a JSON file. You can open this with a text editor to see that, indeed, all the vertices are listed for each polygon.

Further, the python standard library (import json) treats the json objects as dictionaries. You can then simply loop through your dictionaries to write the vertex values (and any other attributes you want) to a csv file. If I get it to work I'll come back & post the soln.

share|improve this answer

Here's a work-around in desperate times:

  • Start editing the feature-class or shapefile
  • Select the polygon feature and right-click to 'Edit Vertices'
  • Right-click on one of the vertices and select 'Sketch Properties'
  • A fly-out will appear with the coordinates of the vertices listed
  • Take a screen-shot of the coordinate list
  • Paste the screen-shot into your favourite photo/picture editor and save as a jpeg/png/bmp etc
  • Google 'Free online OCR' Pick one from the results (some are better than others)
  • Upload your file of the coordinate screen shot and convert
  • Choose your output file type (txt, Excel etc)
  • Check results as some OCR converters are rubbish!!!
  • Use the add X,Y data in Arcmap to create a point dataset.

This method is OK for small datasets but the dependency/limitations on the OCR converters are the main concern. Use with caution.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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