arcgis-python-api
arcgis-python-api copied to clipboard
Unable to geocode using a stand alone arcgis server geocoding service
Describe the bug
Using Python API v2.1.0.3
We are working with a standalone arcgis server that hosts a secured geocoding service. We are able to successfully initialize the server object and get the geocoding service and construct the Geocoder object. However the batch_geocode operation fails with an error 'Geocoder' object has no attribute 'find'
To Reproduce Steps to reproduce the behavior:
from arcgis.gis import server
from arcgis.geocoding import batch_geocode, Geocoder
server_base_url = "https://fqdn/arcgis"
# initialize server connection
gis_server = server.Server(url=f"{server_base_url}/admin", username=user, password=pswd,
expiration=2880, initialize=True)
# get geocoding service
geocoder_na_service = gis_server.content.get("NorthAmerica")
# init geocoder object from geocoder service
geocoder_na = Geocoder(geocoder_na_service)
# batch geocode
result = batch_geocode(addresses=["380 new york st, redlands, ca"],
category="Street Address", out_sr=4326, geocoder=geocoder_na,
as_featureset=True, match_out_of_range=True, location_type='street' )
print(result)
error:
AttributeError: 'Geocoder' object has no attribute 'find'
Screenshots
If applicable, add screenshots to help explain your problem.
Expected behavior Was expecting a result featureset
Platform (please complete the following information):
- OS: Windows
- Python API Version v2.1.0.3
@anandak does your geocoding service support batch geocoding?
@achapkowski yes, the geocoding service has support for batch geocoding