Reverse Geocode (Geocoding)

Summary

Creates addresses from point locations in a feature class. The reverse geocoding process searches for the nearest address, place, or intersection for the point location based on optimized distance values for locators created with the Create Locator tool.

Performing geocoding operations using the ArcGIS World Geocoding Service requires an ArcGIS organizational account, and it consumes credits. The organizational account must have enough credits to complete the entire geocoding request.

Note:

Credit estimation is available at the top of the tool when the active portal is ArcGIS Online and the input locator is the ArcGIS World Geocoding Service.

Usage

  • The input feature class must contain point shapes with valid x,y coordinates. Results will not be returned on points with null coordinates.

  • The output feature class will contain the same number of records as in the input feature class. Additional fields containing the result addresses or places are added to the feature class. The names of the fields are prefixed with REV_. If a matching place or address cannot be found, the fields will contain empty values.

  • If the spatial reference of the input feature class is different from that of the locator, the locator will transform the coordinates on the fly and try to find the match. The output feature class will be saved in the same spatial reference as the input feature class. To change the spatial reference of the output feature class, set a different output coordinate system in the tool's environment settings.

  • If a point in the input feature class fails to return a matching place or address, it means there are no features in the locator that can be associated with the input point. The following are common causes for unmatched points:

    • The point contains null coordinates.
    • The point's coordinates are incorrect and cannot be transformed to the spatial reference used in the locator.
    • The locator does not contain reference features in the area that can be associated with the point.
    • A feature type was specified for which there are no good matches within a reasonable distance. See Feature type match conditions for details.

  • An ArcGIS Online for organizations subscription is required to reverse geocode a feature class using the ArcGIS World Geocoding Service.

Parameters

LabelExplanationData Type
Input Feature Class or layer

A point feature class or layer from which matching places or addresses will be returned based on the features' point location.

Feature Layer
Input Address Locator

The locator that will be used to reverse geocode the input feature class or layer.

Address Locator
Output Feature Class

The output feature class.

Note:

Saving the output to shapefile format is not supported due to shapefile limitations.

Feature Class
Output Address Type
(Optional)
Legacy:

This parameter is deprecated and maintained only for backward compatibility. By default, the feature types supported by the locator will be used.

String
Search Distance
(Optional)
Legacy:

This parameter is deprecated and maintained only for backward compatibility. By default, optimized hierarchical distance values will be used based on the roles supported by the locator and cannot be overridden.

Linear Unit
Feature Type
(Optional)

Specifies the possible match types that will be returned. A single value or multiple values can be selected. If a single value is selected, the search tolerance for the input feature type is 500 meters. If multiple values are included, the default search distances specified in the feature type hierarchy table will be applied. See Feature types for details about the Feature Type parameter for reverse geocoding.

This parameter is not supported for all locators.

  • SubaddressThe match will be limited to a street address based on points that represent house and building subaddress locations. This option requires a locator created in ArcGIS Pro 2.8 or later and ArcGIS Enterprise 10.9 or later if published as a service.
  • Point AddressThe match will be limited to a street address based on points that represent house and building locations.
  • ParcelThe match will be limited to a plot of land that is considered real property and can include one or more homes or other structures. This match type typically has an address and a parcel identification number assigned to it.
  • Street AddressThe match will be limited to a street address that differs from Point Address because the house number is interpolated from a range of numbers. Street Address matches include the house number range for the matching street segment rather than the interpolated house number value.
  • Street Intersection The match will be limited to a street address consisting of a street intersection along with city and optional state and postal code information. This is derived from Street Address reference data, for example, Redlands Blvd & New York St, Redlands, CA, 92373.
  • Street NameThe match will be limited to a street address similar to Street Address but without house numbers along with administrative divisions and optional postal code, for example, W Olive Ave, Redlands, CA, 92373.
  • LocalityThe match will be limited to a place-name representing a populated place.
  • PostalThe match will be limited to a postal code. Reference data is postal code points, for example, 90210 USA.
  • Point of InterestThe match will be limited to a point of interest. Reference data consists of administrative division place-names, businesses, landmarks, and geographic features, for example, Starbucks.
  • Distance Marker The match will be limited to a street address that represents the linear distance along a street, typically in kilometers or miles, from a designated origin location, for example, Mile 25 I-5 N, San Diego, CA.
String
Preferred Location Type
(Optional)

Specifies the preferred output geometry that will be returned for Point Address matches. The options for this parameter are a side of street location, which can be used for routing, or the location that represents the rooftop or parcel centroid for the address. If the preferred location does not exist in the data, the default location will be returned. For geocode results with Addr_type=PointAddress, the x,y attribute values describe the coordinates of the address along the street, and the DisplayX and DisplayY values describe the rooftop or building centroid coordinates.

This parameter is not supported for all locators.

  • Address locationGeometry for geocode results that represent an address location such as a rooftop, building centroid, or front door will be returned.
  • Routing locationGeometry for geocode results that represent a location close to the side of the street that can be used for vehicle routing will be returned. This is the default.
String

arcpy.geocoding.ReverseGeocode(in_features, in_address_locator, out_feature_class, {address_type}, {search_distance}, {feature_type}, {location_type})
NameExplanationData Type
in_features

A point feature class or layer from which matching places or addresses will be returned based on the features' point location.

Feature Layer
in_address_locator

The locator that will be used to reverse geocode the input feature class or layer.

Address Locator
out_feature_class

The output feature class.

Note:

Saving the output to shapefile format is not supported due to shapefile limitations.

Feature Class
address_type
(Optional)
Legacy:

This parameter is deprecated and maintained only for backward compatibility. By default, the feature types supported by the locator will be used.

String
search_distance
(Optional)
Legacy:

This parameter is deprecated and maintained only for backward compatibility. By default, optimized hierarchical distance values will be used based on the roles supported by the locator and cannot be overridden.

Linear Unit
feature_type
[feature_type,...]
(Optional)

Specifies the possible match types that will be returned. A single value or multiple values can be selected. If a single value is selected, the search tolerance for the input feature type is 500 meters. If multiple values are included, the default search distances specified in the feature type hierarchy table will be applied. See Feature types for details about the feature_type parameter for reverse geocoding.

This parameter is not supported for all locators.

  • SUBADDRESSThe match will be limited to a street address based on points that represent house and building subaddress locations. This option requires a locator created in ArcGIS Pro 2.8 or later and ArcGIS Enterprise 10.9 or later if published as a service.
  • POINT_ADDRESSThe match will be limited to a street address based on points that represent house and building locations.
  • PARCELThe match will be limited to a plot of land that is considered real property and can include one or more homes or other structures. This match type typically has an address and a parcel identification number assigned to it.
  • STREET_ADDRESSThe match will be limited to a street address that differs from POINT_ADDRESS because the house number is interpolated from a range of numbers. STREET_ADDRESS matches include the house number range for the matching street segment rather than the interpolated house number value.
  • STREET_INTERSECTIONThe match will be limited to a street address consisting of a street intersection along with city and optional state and postal code information. This is derived from STREET_ADDRESS reference data, for example, Redlands Blvd & New York St, Redlands, CA, 92373.
  • STREET_NAMEThe match will be limited to a street address similar to STREET_ADDRESS but without house numbers along with administrative divisions and optional postal code, for example, W Olive Ave, Redlands, CA, 92373.
  • LOCALITYThe match will be limited to a place-name representing a populated place.
  • POSTALThe match will be limited to a postal code. Reference data is postal code points, for example, 90210 USA.
  • POINT_OF_INTERESTThe match will be limited to a point of interest. Reference data consists of administrative division place-names, businesses, landmarks, and geographic features, for example, Starbucks.
  • DISTANCE_MARKER The match will be limited to a street address that represents the linear distance along a street, typically in kilometers or miles, from a designated origin location, for example, Mile 25 I-5 N, San Diego, CA.
String
location_type
(Optional)

Specifies the preferred output geometry that will be returned for POINT_ADDRESS matches. The options for this parameter are ROUTING_LOCATION, which is the side of street location that can be used for routing and ADDRESS_LOCATION, which is the location that represents the rooftop, parcel centroid for the address, or front door. If the preferred location does not exist in the data, the default location of ROUTING_LOCATION will be returned. For geocode results with Addr_type = "PointAddress", the x,y attribute values describe the coordinates of the address along the street, and the DisplayX and DisplayY values describe the rooftop or building centroid coordinates. See the REST API web help for details about the locationType parameter for reverseGeocode.

This parameter is not supported for all locators.

  • ADDRESS_LOCATIONGeometry for geocode results that represent an address location such as a rooftop, building centroid, or front door will be returned.
  • ROUTING_LOCATIONGeometry for geocode results that represent a location close to the side of the street that can be used for vehicle routing, will be returned. This is the default.
String

Code sample

ReverseGeocode example 1 (Python window)

The following Python window script demonstrates how to use the ReverseGeocode function in immediate mode.


import arcpy

arcpy.env.workspace = "C:/data/locations.gdb"

# Set local variables:
input_feature_class = "customers"
address_locator = "e:/StreetMap/data/Street_Addresses_US.loc"
result_feature_class = "customers_with_address"

arcpy.geocoding.ReverseGeocode(input_feature_class, address_locator, 
                               result_feature_class, "ADDRESS")
ReverseGeocode example 2 (stand-alone script)

The following Python script demonstrates how to use the ReverseGeocode function in a stand-alone script.


# Description: 
# Reverse Geocode customer point locations using a locator created with
# the Create Locator tool.

# Import system modules
import arcpy

# Set workspace
arcpy.env.workspace = "c:/data/Atlanta.gdb"

# Set local variables
input_features = "MyCustomers"
locator = "c:/data/Atlanta/Atlanta_StreetAddress.loc"
reverse_output = "MyCustomers_Reverse_Streets"
addr_type = "ADDRESS"
feature_type = "STREET_INTERSECTION;STREET_ADDRESS"
location_type = "ROUTING_LOCATION"

# Run ReverseGeocode
arcpy.geocoding.ReverseGeocode(input_features, locator, reverse_output, 
                               addr_type, None, feature_type, location_type)
ReverseGeocode example 3 (stand-alone script)

The following Python script demonstrates how to use the ReverseGeocode function with ArcGIS World Geocoding Service in a stand-alone script.

Note:

If you are working with locators on a portal, ensure that you are signed in and have set the portal as your active portal in ArcGIS Pro. To access a locator that is on a portal other than your active portal, authenticate it using the SignInToPortal function.


# Description: 
# Reverse Geocode customer point locations using the ArcGIS World Geocoding Service.

# Import system modules
import arcpy

# Set workspace
arcpy.env.workspace = "c:/data/Atlanta.gdb"

# Set local variables
input_features = "MyCustomers"
locator = "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/ArcGIS World Geocoding Service"
reverse_output = "MyCustomers_Reverse_Streets"
addr_type = "ADDRESS"
feature_type = "STREET_INTERSECTION;STREET_ADDRESS"
location_type = "ROUTING_LOCATION"

# Run ReverseGeocode
arcpy.geocoding.ReverseGeocode(input_features, locator, reverse_output, 
                               addr_type, None, feature_type, location_type)

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics