GIS_REVERSE_COORDINATE: Returning a Geographic Component

How to:

Given longitude and latitude values and the name of a geographic component, GIS_REVERSE_COORDINATE returns the specified geographic component values associated with those coordinates.

Note: This function uses GIS services and requires an Esri ArcGIS adapter connection with named credentials.

Syntax: How to Return a Geographic Component

GIS_REVERSE_COORDINATE(longitude, latitude, component)

where:

longitude

Numeric

Is the longitude of the component to return.

latitude

Numeric

Is the latitude of the component to return.

component

Keyword

Is one of the following components:

  • MATCH_ADDRESS, which returns the matching address.
  • METROAREA, which returns the metro area name.
  • REGION, which returns the region name.
  • SUBREGION, which returns the subregion name.
  • CITY, which returns the city name.
  • POSTAL, which returns the postal code.

The value is returned as text and can be assigned to a field with text or alphanumeric (fixed or variable length) format.

Example: Returning Geographic Components Associated With Coordinates

The following request uses city longitude and city latitude to return the matching address, postal code, region, and subregion.

TABLE FILE WF_RETAIL_GEOGRAPHY
SUM FST.CITY_LONGITUDE AS Longitude FST.CITY_LATITUDE AS Latitude
COMPUTE 
MatchingAddress/A250 = GIS_REVERSE_COORDINATE(CITY_LONGITUDE,
                           CITY_LATITUDE, MATCH_ADDRESS);
PostalCode/A250 = GIS_REVERSE_COORDINATE(CITY_LONGITUDE,
                  CITY_LATITUDE, POSTAL);
Region/A250 = GIS_REVERSE_COORDINATE(CITY_LONGITUDE, CITY_LATITUDE,
              REGION);
Subregion/A250 = GIS_REVERSE_COORDINATE(CITY_LONGITUDE, CITY_LATITUDE,
                 SUBREGION);
BY CITY_NAME AS City
WHERE COUNTRY_NAME EQ 'United States'
WHERE TOTAL PostalCode NE ' '
WHERE RECORDLIMIT EQ 20
ON TABLE SET PAGE NOLEAD
END

The output is shown in the following image.