Find the closest intersection from a point


PurposeThis sample shows how to use ArcObjects to reverse geocode a point given an x,y-value and return the closest intersection to that point.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Start Visual Studio and open the solution.
  2. Add the path to your locator to the GetLocatorWorkspaceFromPath() method.
  3. Add the name of your locator.
  4. Build the solution.
  5. Run the ClosestIntersectionFromPoint application.
  6. Type an x-value at the command prompt.
  7. Type a y-value at the command prompt.

ClosestIntersectionFromPoint/FindClosestIntersection.cs All functionality for this sample is located in this class.
Download the C# files
ClosestIntersectionFromPoint/FindClosestIntersection.vb All functionality for this sample is located in this class.
Download the VB.NET files

Download the files for all languages




Additional Requirements
  • A workspace that contains an address locator that supports intersection geocoding.

Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced