XY Table to FeatureClass

3277
7
Jump to solution
05-19-2020 06:28 PM
adamwade1
New Contributor III

Has anyone figured out a slick way to convert a table with X and Y coordinate values, along with other attributes, to a featureclass in arcpy outside of ArcGIS Desktop like in Spyder or Pycharm? 

Roland Vigor from the USGS documented a nice way of converting a pandas dataframe to an arcgis table. I'd like to do something like that only one step further to make a featureclass. 

I can use the Make XY Event Layer tool and display the points in Arc and then export those values to a feature class. However, I have dozens of files I need to filter in pandas and then convert to feature classes. So doing it outside of ArcMap using arcpy would be the best process. 

I've seen a lot of requests for such a process but have yet to find something that works outside of ArcMap. Any help is much appreciated. 

Cheers!

-Adam 

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

it exists in ArcMap as well

NumPyArrayToFeatureClass—Help | Documentation 


... sort of retired...

View solution in original post

7 Replies
JoeBorgione
MVP Emeritus

When you say 'outside of arcmap' what specifically do you mean? You can do plenty of data table formatting with python, pandas or numpy.  But at the end of the day to create a an ESRI feature class, you are going to deploy arcpy.

That should just about do it....
0 Kudos
adamwade1
New Contributor III

Hi Joe, 

Yes, a user can call arcpy functions in other python environments like Spyder and Pycharm. I like to code in Spyder and automate several arcpy functions using hundreds somethings thousands of separate datasets.  For this particular project I had to filter dozens of datasets with geospatial info including XY coordinate values and am trying to covert them to point feature classes for use in ArcMap. 

0 Kudos
DanPatterson
MVP Esteemed Contributor

NumPyArrayToTable—Data Access module | Documentation if you have arrays already

or you can read xy-whatever data like text files and spreadsheets using python, numpy or pandas,

then

NumPyArrayToFeatureClass—Data Access module | Documentation 

works for point data easily, but you need some magic with arcpy to get poly* features.


... sort of retired...
0 Kudos
adamwade1
New Contributor III

Thanks Dan. I think the NumPyArrayToFeatureClass tool would work but it looks like it only runs in ArcGIS Pro and unfortunately I'm running ArcGIS Desktop. 

0 Kudos
DanPatterson
MVP Esteemed Contributor

it exists in ArcMap as well

NumPyArrayToFeatureClass—Help | Documentation 


... sort of retired...
adamwade1
New Contributor III

Thanks Dan! That totally worked!

Cheers!

-Adam 

0 Kudos
CPoynter
Occasional Contributor III

Hi Adam,

An alternative method: ArcPy | Geospatiality 

Regards,


Craig

0 Kudos