ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Reverse Geocode

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

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.

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. Changing the spatial reference of the output feature class is possible by setting 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 a few 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 that the chance of finding the nearest address is greater, 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 if you reverse geocode a feature class using the ArcGIS World Geocoding Service. See Working with the ArcGIS Online World Geocoding Service for more information.

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 Class
in_address_locator

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

Legacy:

Locators should be stored in a file folder so you take advantage of new features that are not supported for locators stored in geodatabases, such as performance improvements, multithreading capabilities, and suggestions support. ArcGIS 10.4 is the last release to support storing locators in geodatabases.

Address Locator
out_feature_class

The output feature class.

Feature Class
address_type
(Optional)

Specifies whether to return addresses for the points as street addresses or intersection addresses if the address locator supports intersection matching.

  • ADDRESS —Returns street addresses or in the format defined by the input address locator. This is the default option.
  • INTERSECTION —Returns intersection addresses. This option is available if the address locator supports matching intersection addresses.
String
search_distance
(Optional)

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. The default search distance for address locators created with the Create Address Locator tool is 100 meters.

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

Limits the possible match types returned. Single 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.

Note:

If more than one value is specified for the parameter, the values must be separated by a comma, with no spaces after the comma.

  • POINT_ADDRESS —A street address based on points that represent house and building locations.
  • STREET_ADDRESS —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 —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_NAME —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.
  • LOCALITY —A place-name representing a populated place.
  • POSTAL —A postal code. Reference data is postal code points, for example, 90210 USA.
  • POINT_OF_INTEREST —Points of interest. Reference data consists of administrative division place-names, businesses, landmarks, and geographic features, for example, Starbucks.
  • DISTANCE_MARKER —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)

This parameter is available for locators that support the locationType parameter. It specifies the preferred output geometry for PointAddress matches. The options for this parameter are a side-of-street location that 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 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_LOCATION —Returns geometry for geocode results that could represent an address location such as rooftop, building centroid, or front door.
  • ROUTING_LOCATION —Returns geometry for geocode results that represent a location close to the side of the street, which can be used for vehicle routing. 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:/ArcTutor/Geocoding/atlanta.gdb"

# Set local variables:
input_feature_class = "geocode_result"
address_locator = "C:/ArcTutor/Geocoding/Atlanta.loc"
result_feature_class = "customers_with_address"

arcpy.ReverseGeocode_geocoding(input_feature_class, address_locator, 
                               result_feature_class, "ADDRESS", "100 Meters")
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 the ArcGIS World Geocoding Service using SignInToPortal and 
# Ready-To-Use-Services that returns multiple feature types and preferred location.

import arcpy
import os

arcpy.SignInToPortal_server("<Username>","<Password>", "https://geocode.arcgis.com/arcgis")

# Set workspace
arcpy.env.workspace = r"C:\arcgis\ArcTutor\Geocoding\atlanta.gdb"

# Set local variables
in_feature_class = "customers_ParcelBlk"
address_locator = "Ready-To-Use Services/Geocoding/ArcGIS World Geocoding Service.GeocodeServer"
out_feature_class = "customers_with_streets"
addr_type = "ADDRESS"
search_distance = "0 Meters"
feature_type = "STREET_ADDRESS;STREET_INTERSECTION"
location_type = "ROUTING_LOCATION"

# Perform Reverse Geocoding
arcpy.ReverseGeocode_geocoding(in_feature_class, address_locator, out_feature_class,
                               addr_type, search_distance, feature_type, location_type)
ReverseGeocode example 3 (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 the ArcGIS World Geocoding Service using an ArcGIS Server connection file
# that returns multiple feature types and preferred location.

# Import system modules
import arcpy
import os

# Set workspace
arcpy.env.workspace = r"C:\arcgis\ArcTutor\Geocoding\atlanta.gdb"

# Set local variables
in_feature_class = "customers_ParcelBlk"
# Create this ags connection file in ArcMap
address_locator = r"C:/connection_files/arcgis on geocode.arcgis.com (user)/World.GeocodeServer"
out_feature_class = "customers_with_streets"
addr_type = "ADDRESS"
search_distance = "0 Meters"
feature_type = "STREET_ADDRESS;STREET_INTERSECTION"
location_type = "ROUTING_LOCATION"

# Perform Reverse Geocoding
arcpy.ReverseGeocode_geocoding(in_feature_class, address_locator, out_feature_class,
                               addr_type, search_distance, feature_type, location_type)

Environments

  • Output Coordinate System

Licensing information

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

Related topics

  • Getting an address from a location
  • An overview of the Geocoding toolbox

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal