I have a point SHP in WGS84 (EPSG 4326) and I am trying to tabulate the distances to the nearest point in meters. I need to do the analysis using ArcPy, but I want to get the results in a Pandas dataframe to do other things.
I'm stuck on getting the GenerateNearTable_analysis()
in an in-memory format (throws the error below). And then from there, I actually don't know how to pass it into a dataframe.
import arcpy
import pandas as pd
filein = [
r'D:\mypath\test1.shp',
r'D:\mypath\test2.shp',
]
for f in filein:
fout = f.replace(".shp", "")
TempTab = 'in_memory\\{}_Table'.format(fout)
arcpy.GenerateNearTable_analysis(f, f, TempTab, method='GEODESIC')
Above throws this error:
arcgisscripting.ExecuteError: ERROR 000210: Cannot create output in_memory\D:\mypath\test_Table
Failed to execute (GenerateNearTable).
I also tried arcpy.GenerateNearTable_analysis(f, TempTab, "memory", method='GEODESIC')
as suggested in this answer, and got the following error: arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Near Features: Dataset 'in_memory\D:\mypath\test_Table' does not exist or is not supported Failed to execute (GenerateNearTable).
Using ArcMap 10.7