AnsweredAssumed Answered

How to get Borough names using ArcGIS API for Python through geocoding?

Question asked by schuckfandre on Dec 18, 2018
Latest reply on Dec 27, 2018 by schuckfandre
I'm new to ArcGIS API for Python. Is it possible to do do geocoding of an area, specifically New York City and get all the boroughs' names (that are already saved in ArcGis database)?
i.e.: Geocode request for all boroughs in New York city and get in the 'District' element: 'Bronx, Brooklyn, Manhattan, Queens, Staten Island'
in[x]: geocoding.geocode('New York, NY') 
out[x]:{'address': 'New York', 'location': {'x': -74.00713999999994, 'y': 40.71455000000003},
  'score': 100, 
  'attributes': {'Loc_name': 'World',  
   'Status': 'T',  
   'Score': 100,  
   'Match_addr': 'New York',  
   'LongLabel': 'New York, NY, USA',  
   'ShortLabel': 'New York',  
   'Addr_type': 'Locality',  
    'Type': 'City',  
   'PlaceName': 'New York',  
   'Place_addr': 'New York',  
   'Rank': 2.5,  
    'AddBldg': '',  
    'Nbrhd': '',  
    'District': '',  
   'City': 'New York',  
    'MetroArea': 'New York City Metro',  
    'Subregion': 'New York County',  
   'Region': 'New York',  
   'RegionAbbr': 'NY',  
   'Territory': '',  
   'Country': 'USA',  
   'LangCode': 'ENG',  
    'Distance': 0,'}, 
   'extent': {'xmin': -74.25713999999994,  
   'ymin': 40.46455000000003,  
    'xmax': -73.75713999999994,  
   'ymax': 40.96455000000003}}

 

Outcomes