Esri / arcgis-python-api

Documentation and samples for ArcGIS API for Python
https://developers.arcgis.com/python/
Apache License 2.0
1.9k stars 1.1k forks source link

GeoSeries.from_df Geocoding Addresses in Wrong Location #1233

Closed justingreco closed 2 years ago

justingreco commented 2 years ago

We upgraded our Python API to 2.0 recently and just discovered that when geocoding using the GeoSeries.from_df() function, the geometries are getting assigned to the wrong row. I have verified that it is an issue with both the world geocoding service and our own address locator. In the screenshot on the map 1328 Steinbeck Dr, Raleigh, NC 27609 is showing as at 603 W Morgan St, Raleigh, NC 27603, which is also in the list of addresses. It looks like it is getting out of order during the conversion.

Note: tried this in an ArcGIS Online Notebook (version 1.9.1. of the API) and see the same results. See the correct results at 1.8.2. After further testing on different version, looks like this is happening since 1.9.0, seeing correct results at 1.8.5.

from arcgis import GIS, pd
gis = GIS()
addresses = ['3216 Emerald Ridge Ct, Raleigh, NC 27616',
 '3516 Cartway Ln, Raleigh, NC 27616',
 '4100 Breadfruit Ct, Raleigh, NC 27616',
 '3803 Jagalene Ln, Raleigh, NC 27616',
 '3404 Barlon Ct, Raleigh, NC 27616',
 '301 S Person St, Raleigh, NC 27601',
 '4208 Union St, Raleigh, NC 27609',
 '816 S Wilmington St, Raleigh, NC 27601',
 '5501 Atlantic Springs Rd, Raleigh, NC 27616',
 '417 W Peace St 010, Raleigh, NC 27603',
 '3801 Computer Dr 102, Raleigh, NC 27609',
 '2828 Industrial Dr, Raleigh, NC 27609',
 '2400 E Millbrook Rd, Raleigh, NC 27604',
 '18 Seaboard Ave, Raleigh, NC 27604',
 '2331 Grant Ave 125, Raleigh, NC 27608',
 '12815 Strickland Rd, Raleigh, NC 27613',
 '711 Brookside Dr, Raleigh, NC 27604',
 '2413 Blue Ridge Rd, Raleigh, NC 27607',
 '1328 Steinbeck Dr, Raleigh, NC 27609',
 '603 W Morgan St, Raleigh, NC 27603']

df = pd.DataFrame(addresses, columns=['address'])

geocoded = features.GeoAccessor.from_df(df, 'address')

m = gis.map('Raleigh, NC')

geocoded.spatial.plot(map_widget=m)
m
image
nanaeaubry commented 2 years ago

Thank you for reporting this, we will take a look and post further updates

nanaeaubry commented 2 years ago

Will be fixed in the next release