<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error message when ArcGIS cant return an address within distance parameter in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-message-when-arcgis-cant-return-an-address/m-p/538243#M42097</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The coordinate you entered was in Antactica, if you are looking in New York this works but you need a search distance of 1000 metres as its in the river:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-73.955443,40.759516&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?location=-73.955443%2C40.759516&amp;amp;distance=1000&amp;amp;outSR=&amp;amp;f=pjson" title="http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?location=-73.955443%2C40.759516&amp;amp;distance=1000&amp;amp;outSR=&amp;amp;f=pjson"&gt;http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?location=-73.955443%2C40.759516&amp;amp;distan…&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Aug 2016 15:55:42 GMT</pubDate>
    <dc:creator>BruceHarold</dc:creator>
    <dc:date>2016-08-17T15:55:42Z</dc:date>
    <item>
      <title>Error message when ArcGIS cant return an address within distance parameter</title>
      <link>https://community.esri.com/t5/python-questions/error-message-when-arcgis-cant-return-an-address/m-p/538241#M42095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I am trying to print (geolocator.reverse('40.759516, -73.955443', distance='100')) on an location without an address within the distance parameter. I want to iterate through a list of locations, and store the locations that return a valid address. For example, if I run a iteration with coordinates over New York, I want to store all locations that actually have an address within the set distance. However, now, when there is no address within my set distance, I get an error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; File "./google.py", line 28, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; location = geolocator.reverse(water, distance='100')&lt;BR /&gt;&amp;nbsp; File "/home/strix/anaconda3/lib/python3.5/site-packages/geopy/geocoders/arcgis.py", line 202, in reverse&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise GeocoderServiceError(str(response['error']))&lt;BR /&gt;geopy.exc.GeocoderServiceError: {'code': 400, 'message': 'Cannot perform query. Invalid query parameters.', 'details': ['Unable to find address for the specified location.']}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas how to write a code that can handle such an error? Is it even possible since my script actually crashes (I am quite new to python, so please excuse any noob language).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from geopy.geocoders import ArcGIS&lt;BR /&gt;geolocator = ArcGIS()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;location = geolocator.reverse('40.759516, -73.955443', distance='100')&lt;BR /&gt;print (location)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nils&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2016 03:19:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-message-when-arcgis-cant-return-an-address/m-p/538241#M42095</guid>
      <dc:creator>NilsRudqvist</dc:creator>
      <dc:date>2016-08-17T03:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Error message when ArcGIS cant return an address within distance parameter</title>
      <link>https://community.esri.com/t5/python-questions/error-message-when-arcgis-cant-return-an-address/m-p/538242#M42096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nils&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might get better support sticking to 'unwrapped' approaches, i.e. vanilla Python calling Esri's REST API natively.&amp;nbsp; For example you can leverage the code in this sample to help with your reverse geocoding problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://www.arcgis.com/home/item.html?id=da9efbe1232f426ead182213f53c8cd8" title="http://www.arcgis.com/home/item.html?id=da9efbe1232f426ead182213f53c8cd8"&gt;http://www.arcgis.com/home/item.html?id=da9efbe1232f426ead182213f53c8cd8&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Be aware storing the results of ArcGIS Online geocoding or reverse geocoding requires service credits; in the sample the user token is picked up from the app but you can do it standalone with the generateToken call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2016 15:03:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-message-when-arcgis-cant-return-an-address/m-p/538242#M42096</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2016-08-17T15:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Error message when ArcGIS cant return an address within distance parameter</title>
      <link>https://community.esri.com/t5/python-questions/error-message-when-arcgis-cant-return-an-address/m-p/538243#M42097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The coordinate you entered was in Antactica, if you are looking in New York this works but you need a search distance of 1000 metres as its in the river:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-73.955443,40.759516&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?location=-73.955443%2C40.759516&amp;amp;distance=1000&amp;amp;outSR=&amp;amp;f=pjson" title="http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?location=-73.955443%2C40.759516&amp;amp;distance=1000&amp;amp;outSR=&amp;amp;f=pjson"&gt;http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?location=-73.955443%2C40.759516&amp;amp;distan…&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2016 15:55:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-message-when-arcgis-cant-return-an-address/m-p/538243#M42097</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2016-08-17T15:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Error message when ArcGIS cant return an address within distance parameter</title>
      <link>https://community.esri.com/t5/python-questions/error-message-when-arcgis-cant-return-an-address/m-p/538244#M42098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the help. I will definitely look into using the native Esri REST API. Thanks for providing a link. I am not sure I understand the part about credits, but Ill make sure to read up on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Nils&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Aug 2016 02:12:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-message-when-arcgis-cant-return-an-address/m-p/538244#M42098</guid>
      <dc:creator>NilsRudqvist</dc:creator>
      <dc:date>2016-08-20T02:12:51Z</dc:date>
    </item>
  </channel>
</rss>

