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
Solved! Go to Solution.
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.
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.
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.
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.
Thanks Dan! That totally worked!
Cheers!
-Adam