Select to view content in your preferred language

How do I export cordinates of polygon shapes to excel.

10838
14
03-13-2017 06:14 AM
Nicolettevan_den_Heever
Deactivated User

I received shape files, and imported it.  I can see the shapes, but I need to export the cordinate points of the shape to an excel or csv file in order to import into another program.

0 Kudos
14 Replies
DanPatterson_Retired
MVP Emeritus

You still have a shapefile...

Line 9.... it is Shape@ , not Shape*

I prefer https://community.esri.com/message/672481-re-how-do-i-export-cordinates-of-polygon-shapes-to-excel?c... 

0 Kudos
MRC
by
Occasional Contributor

""You still have a shapefile..."" what would file i need ??

i changed it to shape@ but still same, can you use this code and run it ? then you can find the point i fail, thanks you very much because help me ....

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Havan Cong ,

When you look at the original code I provided, you will see on line 4:

    fc = r'C:\GeoNet\WKT\data.gdb\polygons'  # the input polygons

In my case, I have a featureclass named "polygons" which is stored inside a file geodatabase called "data.gdb" inside the folder "C:\GeoNet\WKT". 

In your case you have:

    fc = r'C:\GeoNet\WKT\data.gdb\polygons.shp'

You are using a shapefile called "polygons.shp" which is located inside a folder called "C:\GeoNet\WKT\data.gdb". Possibly using a folder name with a point in it is causing the problems or maybe there is something wrong with the polygon shapefile. Is it possible to attach a ZIP file with the shapefile to this thread to see what is causing the problem?

The error indicates that it cannot open the shapefile.

MRC
by
Occasional Contributor

Thank you for your help Xander, it's worked. But the result of a test run i get not like my wish 

example: the coordinates of polygon i use is a GCS_WGS_1984 and the result show me like this 

but the file result i want to receive like below : 

the type coordinates is Degree same like coordinates of Google earth file 

Could you please help me change a little bit of the code and then export the coordinates like i hope

thank you very much Xander....

0 Kudos
XanderBakker
Esri Esteemed Contributor

I guess that if you project your coordinates to WGS 1984, the result will list the coordinates in WGS 1984 decimal degrees. The code will not change the coordinates, just make sure your shapefile or featureclass is in the right coordinate system before you run the code.