Custom solver


Purpose
This sample provides a custom ArcGIS Network Analyst extension solver for traversing a network dataset and finding connected/disconnected network components.

How to use

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. Open the solution file in Visual Studio.
  2. If your SDK is not installed in "\Program Files (x86)\ArcGIS\DeveloperKit10.1", search for that string and replace all entries with the correct path.
  3. Build the solution.
  4. If the compilation process does not register the CustomSolver.dll into ArcGIS for Desktop, register it manually.
  5. Start ArcMap.
  6. Add a network dataset to the map.
  7. On the Network Analyst toolbar, click Network Analyst > Options, and set it to show all messages.
  8. Open the Network Analyst toolbar and click Network Analyst > New Connectivity.
  9. Load locations into the Seed Points layer of the Connectivity analysis layer.
  10. Click Solve. Lines are added to the Lines layer that reference source features that are not connected to any of the seed points.
  11. Right-click the Connectivity layer and click Properties to change the properties of the analysis layer, including whether you want to output the connected features instead of the disconnected features and whether or not you want to generate the line geometry.
  12. Re-solve to see the effects of changing the analysis layer properties.

ConnectivitySolver.h Header file for defining the connectivity solver.
ConnectivitySolver.cpp Implementation of the connectivity solver.
ConnectivitySymbolizer.h Header file for defining the connectivity solver's custom symbolizer.
ConnectivitySymbolizer.cpp Implementation of the connectivity solver's custom symbolizer.
ConnSolverPropPage.h Header file for defining the connectivity solver's custom property page.
ConnSolverPropPage.cpp Implementation of the connectivity solver's custom property page.
DataStructures.h Header file for defining custom data structures.
NameConstants.h Header file for defining custom string values.
Resource.h Header file for defining resource IDs.
StdAfx.h Used for building a precompiled header file and precompiled type file.
StdAfx.cpp Used for building a precompiled header file and precompiled type file.
CustomSolver.cpp Object map and DLL exports.
CustomSolver.rc Contains a listing of all the Microsoft Windows resources that the program uses.
CustomSolver.rgs Registration script for the custom solver project.
_CustomSolver_i.c GUID definitions for the project.
Download the VCPP files

Download the files for all languages




Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic: Network Analyst
ArcGIS for Desktop Standard ArcGIS for Desktop Standard: Network Analyst
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced: Network Analyst