This document is archived and information here might be outdated.  Recommended version.


IGeocodeServer.ReverseGeocode Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Location)  

IGeocodeServer.ReverseGeocode Method

Generates an address for a point.

[Visual Basic .NET]
Public Function ReverseGeocode ( _
    ByVal location As IPoint, _
    ByVal bReturnIntersection As Boolean, _
    ByVal propMods As IPropertySet _
) As IPropertySet
[C#]
public IPropertySet ReverseGeocode (
    IPoint location,
    bool bReturnIntersection,
    IPropertySet propMods
);
[C++]
HRESULT ReverseGeocode(
  IPoint* location,
  VARIANT_BOOL bReturnIntersection,
  IPropertySet* propMods,
  IPropertySet** ppResult
);
[C++]

Parameters location [in]
location is a parameter of type IPoint bReturnIntersection [in] bReturnIntersection is a parameter of type VARIANT_BOOL propMods [in]
propMods is a parameter of type IPropertySet ppResult [out, retval]
ppResult is a parameter of type IPropertySet

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

The ReverseGeocode method returns the address closest to the given point, and within a specified search distance.

The location parameter is a Point object that represents the point at which to search for the closest address. Note that the Point passed to this parameter have the same spatial reference as the GeocodeServer's output. The easiest way to get the spatial reference from the GeocodeServer is to use the GetResultFields method to get the result Fields, and then get the spatial reference from the shape field's GeometryDef object. If the Point is in some other spatial reference (such as a point feature from another feature class), then you must first project the point into the GeocodeServer's output spatial reference. This is most easily done using the IPoint::Project method.

The bReturnIntersection parameter indicates whether the GeocodeServer should return the nearest intersection to the given point. If the value of this parameter is True, then the GeocodeServer will return the nearest intersection to the given point, provided that the GeocodeServer supports intersection geocoding, and provided that there is an intersection within the reverse geocoding search distance. If the value of this parameter is False, then the GeocodeServer will return the nearest address to the given point, provided that there is an address within the GeocodeServer 's reverse geocoding search tolerance.

The propMods parameter is a PropertySet containing the geocoding properties to use for reverse geocoding. There are two properties that are relevant to reverse geocoding. The ReverseDistance and ReverseDistanceUnits properties specify the distance from the given point to which to search for addresses. When specifying the ReverseDistanceUnits property, use a string to indicate the units to use. For example, when searching for an address using a search distance specified in esriMeters, use the string "Meters" to specify the search distance units. Refer to the esriUnits enumeration for a list of all supported search distance units.

The PropertySet returned by the ReverseGeocode method contains properties that describe the address. The names of the properties are the names of the Fields returned by the GetAddressFields method, and their values correspond to the components of the nearest address. In fact, the PropertySet returned by the ReverseGeocode method could be passed to the GeocodeAddress method to get the geometry of the closest address to the given point.

See Also

IGeocodeServer Interface