HOW TO

Limit geocoding results to a specific area

Last Published: April 25, 2020

Summary

In some cases, it is necessary to limit the geocoding results to a certain area. For example, an international company with franchises all over the world, and an analyst only requires data for the franchises located in the United Kingdom (UK).

Procedure

The instructions provided describe how to limit the result of geocoding to a specific area:

Use Locator View in ArcGIS Online

  1. Log in to ArcGIS Online using an ArcGIS Online organizational account.
  2. Navigate to Content. Click Create > Locator (view).
  3. Configure the Locator View by setting the location depending on the type of location to search. Click Save.
  4. Navigate to Organization. Click Edit settings.
  5. Go to Utility Services, and add the locator in the Geocoding section. Click Save.
  6. In the map viewer, click the down arrow in the search bar and select the locator to begin searching. For more information, refer to: Customize your Geocoding experience with Locator Views

Configure the JSON file of the custom widget in Web AppBuilder for ArcGIS

It is possible to configure the JSON file to narrow down the geocoding results by editing the suffix parameter. For example, set the suffix parameter to New York and sourceCountry to US to limit the search within New York, US, as shown in the following JSON.

{
 "geocoder":{ 
             "autoComplete": true, 
             "minCharacters": 3, 
             "name": "Esri World Geocoder", 
	     "maxLocations": 3,
             "arcgisGeocoder": false, 
             "geocoders":[ 
                         { 
                          "url": "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer", 
                          "name": "Esri World Geocoder", 
                          "singleLineFieldName": "SingleLine", 
                          "placeholder": "Find address or place", 
                          "suffix": "New York",
	                  "sourceCountry":"US" 
                         } 
                         ]
             }
}

 The searchExtent parameter can also be added to limit the search within a specific extent. For more information, refer to: Class: Geocoder.

"searchExtent": {  
                 "xmin":-10105000, "ymin":2855000, "xmax":-8226000, "ymax":3649000,  
                 "spatialReference": {"wkid":102100}  
                }

Article ID:000019446

Software:
  • ArcGIS Web AppBuilder
  • ArcGIS Online
  • Portal for ArcGIS

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic