Select to view content in your preferred language

Shapefile to Well know text (WKT)

2880
5
03-28-2023 01:01 PM
ClaireKolaja1
Emerging Contributor

Please let me know if this should be posted somewhere else.

I need well know text (WKT) information to download data from another source. 

I have a shapefile that represents zip code polygons; what tool or process can be used to create WKT information for each of the polygons? I am using ArcGIS Pro 3.1.0 and the largest dataset has ~1500 zip codes.

Thanks, C 

0 Kudos
5 Replies
JohannesLindner
MVP Frequent Contributor

You can use the Calculate Field tool to calculate a text field with this Python expression:

!Shape!.wkt

 


Have a great day!
Johannes
ClaireKolaja1
Emerging Contributor

Ah, thank you for sharing this! If I was using point data this would be the way to go. I will keep this in mind if the project decides to move forward that way. 

0 Kudos
Bud
by
Esteemed Contributor

I remember doing something similar: Field Calculator to get JSON text

I made the mistake of making my text field too small. The JSON text wouldn't fit.
So if you run into any issues, that might be something to check.

0 Kudos
VinceAngelo
Esri Esteemed Contributor

The shapefile limit on character width (254) means you can only reliably store ~10 vertices in a dBase file. Rectangles and hexagons are possible; countries, states, counties, and even circles are not. Zipcodes would need to be dumped to CSV or processed in memory, because they could not possibly be stored in a shapefile.

- V

ClaireKolaja1
Emerging Contributor

Hi, my apologies, I am just getting back to this task. Do you have a link with more information on how to do that (dump to a CSV)? I have not done that before. 

V/r, Claire

0 Kudos