1

I am trying to determine the closest line feature to features in a point feature class by using the arcpy.Near_analysis function, as such:

search_radius = '' #optional
location = 'LOCATION'
angle = 'NO_ANGLE'
method = '' #optional
arcpy.Near_analysis(points, lines, search_radius, location, angle, method)

This in a Python window within ArcGIS Pro returns the error:

Traceback (most recent call last):   File "<string>", line 1, in <module>   File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\analysis.py", line 1456, in Near
    raise e   File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\analysis.py", line 1453, in Near
    retval = convertArcObjectToPythonObject(gp.Near_analysis(*gp_fixargs((in_features, near_features, search_radius, location, angle, method), True)))   File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\geoprocessing\_base.py", line 496, in <lambda>
    return lambda *args: val(*gp_fixargs(args, True)) arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Features: Dataset db_gdb.DBO.GPS_Point does not exist or is not supported ERROR 000732: Near Features: Dataset db_gdb.DBO.GPS_Lines does not exist or is not supported Failed to execute (Near).

both 'points' and 'lines' feature classes exist, and other arcpy functions can perform on these exact variables, and I see nothing about them that would prevent them from being supported by this function.

A stand-alone python script(IDLE) throws this error:

Traceback (most recent call last):   File "C:\Users\me\Desktop\file.py", line 40, in <module>
    arcpy.Near_analysis(points, lines, search_radius, location, angle, method)   File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\analysis.py", line 1456, in Near
    raise e   File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\analysis.py", line 1453, in Near
    retval = convertArcObjectToPythonObject(gp.Near_analysis(*gp_fixargs((in_features, near_features, search_radius, location, angle, method), True)))   File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 496, in <lambda>
    return lambda *args: val(*gp_fixargs(args, True)) arcgisscripting.ExecuteError: ERROR 000852: Cannot add field NEAR_FID to C:\Users\me\Documents\ArcGIS\Projects\GPS_Point Failed to execute (Near).

I'm not sure why the two different environments throw different error messages, but I am following the documented guidelines set forth by Esri, so am not sure what the issue is. I have an Advanced license and I see nothing in the documentation that would lead me to think there is something missing in either of these feature classes to prevent this function from working.

3
  • 1
    It sounds like your input features are locked.. or you don't have database permission to alter the table, in the case of file based (personal/file geodatabase or shapefiles) exit out of all Esri products except that one session and try again. To be really safe though restart your computer and open only one session before trying again. In the case of DB permissions you've got bigger problems and need to speak to your DBA, I would suggest though to copy the enterprise database feature class locally and not to change the original. Jan 18, 2019 at 2:32
  • @MichaelStimson that was it, locks. I'm the only one using this db, and have no open apps hitting, but yet there were some 80 locks on various feature classes. Clearning out all the locks allow the code to run. I wish Esri would give better error messages than "I'm sorry Dave, I'm afraid I can't do that"!
    – m.Walker
    Jan 18, 2019 at 4:01
  • Just have a look at all the 'Error 999999' posts to see the prevalence of unanticipated error codes, at least yours had some information, albeit not altogether helpful unless you've hit this one before and spent half a day working out why? to know the evil influence of locks; on a side note, from version 10 Esri products are even more reluctant to release locks - 9.3 released the lock immediately but 10.2 holds onto a lock until you close the window sometimes, so if you've previewed a dataset/table in ArcCatalog the lock may persist indefinitely. Jan 18, 2019 at 4:10

1 Answer 1

1

It looks like database locks, as Michael mentioned, was causing the issue. Releasing the locks allowed me to get past that error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.