Reverse Geocode (Geocoding)

Summary

Creates addresses from point locations in a feature class. The reverse geocoding process searches for the nearest address or intersection for the point location based on the specified search distance. When using the ArcGIS World Geocoding Service, this operation may consume credits.

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

Usage

  • The input feature class must contain point shapes with valid x,y coordinates. Addresses 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 are added to the feature class. The names of the fields are prefixed with REV_. If an address cannot be found, the fields will contain empty values.

  • If the spatial reference of the input feature class is different from the address locator, the address 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 an address, it means there are no features in the address locator that can be associated with the input point. The following are common causes for the unmatched points:

    • The search distance is so small that the point cannot find any nearest features.
    • The point contains null coordinates.
    • The point's coordinates are incorrect and cannot be transformed to the spatial reference used in the address locator.
    • The address locator does not contain reference features in the area that can be associated with the point.

    You can increase the search distance so the chance of finding the nearest address is higher, or use a different address locator that contains more features or covers a larger area to match the input points.

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

Syntax

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

A point feature class or layer from which addresses are returned based on the features' point location.

Feature Layer
in_address_locator

The address locator to use to reverse geocode the input feature class or layer.

Address Locator
out_feature_class

The output feature class.

Feature Class
address_type
(Optional)

Specifies whether addresses for the points will be returned as street addresses or intersection addresses if the locator supports intersection matching.

Legacy:

This parameter only applies to locators built with the Create Address Locator tool or composite locators that contain locators built with the Create Address Locator tool.

  • ADDRESSAddresses will be returned as street addresses or in the format defined by the input address locator. This is the default.
  • INTERSECTIONAddresses will be returned as intersection addresses. This option is available if the address locator supports matching intersection addresses.
String
search_distance

The distance used to search for the nearest address or intersection for the point location. Some locators use optimized distance values that do not support overriding the search distance parameter. Locators created with the Create Address Locator tool have a default search distance of 100 meters.

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

Specifies the possible match types 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 are applied. See the REST API web help for more details about the featureTypes parameter for reverseGeocode.

This parameter is not supported for all locators.

  • POINT_ADDRESSThe match is limited to a street address based on points that represent house and building locations.
  • PARCELThe match is 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 is 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 is 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 is 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 is limited to a place-name representing a populated place.
  • POSTALThe match is limited to a postal code. Reference data is postal code points, for example, 90210 USA.
  • POINT_OF_INTERESTThe match is 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 is 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 for POINT_ADDRESS matches. The options for this parameter are ROUTING_LOCATION, the side of street location, which can be used for routing, or ADDRESS_LOCATION, 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 instead. For geocode results with Addr_type = "PointAddress", the x,y attribute values describe the coordinates of the address along the street, while the DisplayX and DisplayY values describe the rooftop or building centroid coordinates. See the REST API web help for more 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 rooftop, building centroid, or front door is returned.
  • ROUTING_LOCATIONGeometry for geocode results that represent a location close to the side of the street, which can be used for vehicle routing, is returned. This is the default.
String

Code sample

ReverseGeocode example (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"
result_feature_class = "customers_with_address"

arcpy.ReverseGeocode_geocoding(input_feature_class, address_locator, 
                               result_feature_class, "ADDRESS", "100 Meters")
ReverseGeocode example (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"
search_distance = "0 Unknown"
feature_type = "STREET_INTERSECTION;STREET_ADDRESS"
location_type = "ROUTING_LOCATION"

# Execuste ReverseGeocode
arcpy.geocoding.ReverseGeocode(input_features, locator, reverse_output, 
                               addr_type, search_distance, feature_type, 
                               location_type)

Licensing information

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

Related topics