Select to view content in your preferred language

Get WKT Values for a Polygon

451
4
Jump to solution
03-26-2026 10:16 AM
McKenzieBredemeyer
Occasional Contributor

I was wondering if there was an easy way to get the WKT values of a selected polygon to be able to copy and paste? I know there's a way to input WKT and get a polygon, but I need the reverse direction. My company sends polygons into a mapping program of a regulatory agency and the easiest way to get polygons into their mapping program is to copy and paste WKT values, otherwise it's a multi-step process of getting shapefiles converted into their program. The agency used to have an add-in to put into ArcMap so that when we selected a polygon, it would pop up with WKT values to copy and paste, but it looks like they don't plan to create that add-in for ArcGIS Pro (and the ArcMap one does not work in Pro).

1 Solution

Accepted Solutions
Neal_t_k
MVP Regular Contributor

@McKenzieBredemeyer If you can add script tool to a toolbox, this is about as simple as you can make it.  Add one parameter for your input feature. Add this script to the tool and save, To run select a polygon, add the feature layer as the input.  It outputs the WKT in the Messages window.

import arcpy
infc = arcpy.GetParameterAsText(0)
for row in arcpy.da.SearchCursor(infc, ["SHAPE@WKT"]):
    arcpy.AddMessage(row[0])

Screenshot 2026-03-26 132051.png

Screenshot 2026-03-26 132042.png

Screenshot 2026-03-26 132111.png

 

View solution in original post

4 Replies
DavidSolari
MVP Regular Contributor

If you don't mind a bit of python, a Search Cursor with the special SHAPE@WKT field token will return that for every feature you need.

0 Kudos
McKenzieBredemeyer
Occasional Contributor

I would prefer to have something that doesn't work with Python, at least not on the front-facing side of it. My coworkers that will primarily be the ones needing the WKT information do not know python at all, and I only have a basic knowledge of Python to set a tool up for them.

0 Kudos
Neal_t_k
MVP Regular Contributor

@McKenzieBredemeyer If you can add script tool to a toolbox, this is about as simple as you can make it.  Add one parameter for your input feature. Add this script to the tool and save, To run select a polygon, add the feature layer as the input.  It outputs the WKT in the Messages window.

import arcpy
infc = arcpy.GetParameterAsText(0)
for row in arcpy.da.SearchCursor(infc, ["SHAPE@WKT"]):
    arcpy.AddMessage(row[0])

Screenshot 2026-03-26 132051.png

Screenshot 2026-03-26 132042.png

Screenshot 2026-03-26 132111.png

 

McKenzieBredemeyer
Occasional Contributor

Thank you so much, this is so helpful.

0 Kudos