Skip to main content

Reverse Geocode

The reverse_geocode tool converts a longitude/latitude coordinate to the nearest street address or point of interest—the inverse of the forward-geocoding workflow handled by Find Address Candidates.

Tool name

reverse_geocode

Tool alias

Reverse Geocode

Objective

Convert a geographic location (a coordinate pair) to the nearest address or place, returning the full formatted address along with parsed components, a location-type classifier, and the snapped coordinates.

Usage guidance

reverse_geocode converts a geographic location to the nearest address—a workflow commonly known as reverse geocoding. For example, the coordinate −79.3871, 43.6426 resolves to CN Tower, 301 Front St W, Toronto, Ontario, M5V, CAN.

Output

The result includes:

  • The full formatted address as a single string.

  • Parsed components—houseNumber, city, subRegion, region, postCode, and countryCode.

  • A locationType value that indicates the type and precision of the match, such as PointAddress, StreetAddress, or POI. The value comes from the geocode service's Addr_type field, so it does not identify the category of a place, such as a restaurant or hospital.

  • The snapped location coordinates and their spatial reference. You can choose the output spatial reference with the outSR parameter.

Tip:

Prefer the parsed components over string-parsing the address field. The components are stable across regions and locales; the formatted string is not.

Spatial reference

Locations are assumed to be in the WGS84 spatial reference (wkid 4326), but you can pass a different spatial reference using the wkid parameter—for example, 3857 for Web Mercator. To get the returned location in a different spatial reference, set the optional outSR parameter to the WKID you want.

Important:

Coordinate order

When using the default WGS84 (wkid 4326), x is longitude (−180 to 180) and y is latitude (−90 to 90). Double-check the order—passing latitude as x is the most common reverse-geocoding error.

Before calling the tool, the AI assistant checks that the coordinates fall within the valid range for the specified WKID. If they appear to be out of range—or, for WGS84, if |y| is greater than 90 while |x| is 90 or less, which suggests swapped coordinates—the assistant does not call the tool. Instead, it flags the suspected problem and asks you to confirm before proceeding.

Choosing a geocode service

By default, reverse_geocode uses the first geocode service listed in your organization's utility services. You can instead target a specific geocoder with one of two optional parameters:

  • geocodeServerName—The name of a geocode service available in your organization's utility services. The value must match one of the configured service names.

  • geocodeServerUrl—The URL of a geocode service, supplied without the protocol (for example, datahub.esriuk.com/arcgis/rest/services/gb_locators/os_open_names_locator/GeocodeServer).

If both are provided, geocodeServerUrl takes precedence over geocodeServerName. If neither is provided, the first geocode service in the organization's utility services is used. Generally, use the default unless the client clearly asks for a different geocoder.

When to use

  • Get an address that represents a location.

  • The client provides coordinates and asks what they represent in the real world.

  • Show an address for a location selected on a map.

  • Find details for a location, including the type of place.

Sample prompts to test the tool

Send any of the prompts below to your MCP-compatible AI client to verify that reverse_geocode is working correctly. The prompts are grouped to exercise the tool's main inputs and behaviors—from the default WGS84 case through Web Mercator input, output-field validation, a round-trip integration test with find_address_candidates, and edge cases at the limits of the coordinate domain.

Note:

These prompts are for illustration only. Before you use them, modify them to match the data published in your ArcGIS Enterprise environment.

Basic WGS84 coordinates (default)

  • Use my ArcGIS Enterprise reverse geocoding service to find the address at longitude -77.0366, latitude 38.8971.

  • What address is at coordinates x: -118.2437, y: 34.0522 using the USA_Locator in my ArcGIS Enterprise?

  • Reverse geocode the point at x: -87.6298, y: 41.8781 using my Enterprise geocoding service.

Well-known landmarks by coordinate

  • Use my ArcGIS Enterprise reverse geocoder to identify the location at x: -111.0937, y: 44.4280—what address or place does it return?

  • What is at coordinates x: -80.1918, y: 25.7617 according to my Enterprise locator service?

With explicit wkid (Web Mercator)

  • Reverse geocode the Web Mercator coordinates x: -13149598, y: 4036445 using my ArcGIS Enterprise geocoding service with WKID 3857.

  • Use my Enterprise USA_Locator to reverse geocode x: -9757000, y: 5138000 in Web Mercator spatial reference.

Testing output fields

These prompts validate that the response includes parsed components such as region, subRegion, city, and postCode.

  • Use my ArcGIS Enterprise reverse geocoder at x: -71.0589, y: 42.3601 and tell me the city, county, state, and ZIP code it returns.

Chained with find_address_candidates (round-trip test)

These prompts forward-geocode an address, then reverse-geocode the returned coordinates with the same service and compare the result.

  • First use my ArcGIS Enterprise geocoding service to find '350 Fifth Avenue, New York, NY', then reverse geocode the returned coordinates back using the same service—do the results match?

  • Geocode 'Fenway Park, Boston' with my Enterprise locator, then pass those coordinates to the reverse geocoder and compare the input and output addresses.

Edge cases

  • Use my ArcGIS Enterprise reverse geocoder on coordinates x: -106.6504, y: 35.0844—is it a street address or a POI?

  • Use my ArcGIS Enterprise reverse geocoder on x: -180, y: 90.