Hi all,
I get the following error when I run the script with find_nearest function or any other function from use_proximity module. I am lost, tried all kinds of workarounds, nothing worked so far. I would appreciate any help.
The script is as following:
import arcgis
from arcgis.features import FeatureLayer, FeatureLayerCollection, use_proximity
from arcgis.features.use_proximity import find_nearest
from arcgis.geometry import Geometry, Point, Polyline
from arcgis.gis import GIS
agoLogin = GIS(#),
username='#',
password='#',
verify_cert=False)
# Get point layer with trees
trees_layer = agoLogin.content.get('#')
trees = trees_layer.layers[0].query()
# Get line layer with road segments
roads_layer = agoLogin.content.get('#')
roads = roads_layer.layers[0].query()
# Find nearest road segment for each tree
nearest = use_proximity.find_nearest(analysis_layer=trees, near_layer=roads,measurement_type = "StraightLine",gis = agoLogin,max_count=1)
The error is as following:
File "/usr/local/lib/python3.9/site-packages/arcgis/features/use_proximity.py", line 773, in find_nearest
params = inspect_function_inputs(fn=gis._tools.featureanalysis._tbx.find_nearest,
File "/usr/local/lib/python3.9/site-packages/arcgis/_impl/tools.py", line 644, in _tbx
self._gptbx = import_toolbox(url_or_item=self._url, gis=self._gis, verbose=self._verbose)
File "/usr/local/lib/python3.9/site-packages/arcgis/geoprocessing/_tool.py", line 454, in import_toolbox
f = executor.submit(fn=_generate_fn, **{"task": task, "tbx" :tbx})
TypeError: submit() missing 1 required positional argument: 'fn'
Thank you!!!