markparr

Locator problem

Discussion created by markparr on Apr 30, 2011
Latest reply on May 1, 2011 by markparr
I have program that takes a Shapefile centerline layer and will break FROM/TO data ranges of the line segments into "100 block" ranges.  The program geocodes the start of each 100 block range as it runs.  When I run the program with one shapefile which contains around 5500 line segments and produces 20,000 block ranges, things run fine.  I have another shapefile that only contains about 1500 line segments and I am having problems with it.  At various points during the program run, it generates an exception error.  The address that causes the exception is not consistent.  The first time, it might be 4200 MAIN ST and the next time 5000 MAIN ST.

If I use the Locator within ArcMap, it consistently finds the addresses.

The exception is listed below and is taking place on the last line of this code that I have included (ws is an active IWorkspace that is being passed to the processing function):

Exception:
System.Runtime.InteropServices.COMException was unhandled
  Message=Error HRESULT E_FAIL has been returned from a call to a COM component.
  Source=ESRI.ArcGIS.Location
  ErrorCode=-2147467259

Code:
if (locatorManager == null)
{
[INDENT][INDENT]locatorManager = new LocatorManagerClass();
locatorWorkspace = (ILocatorWorkspace)locatorManager.GetLocatorWorkspace(ws);
if (locatorWorkspace == null)
[INDENT]return;[/INDENT][/INDENT][/INDENT]}

IPropertySet addressProperties = new PropertySetClass();
addressProperties.SetProperty("Street", Addr);
addressProperties.SetProperty("City", City);

IAddressGeocoding addressGeocoding = (IAddressGeocoding)locatorWorkspace.GetLocator(LocatorName);
if (addressGeocoding == null)
[INDENT]return;[/INDENT]
IPropertySet matchProperties = addressGeocoding.MatchAddress(addressProperties);


Any ideas?  Thanks.

Outcomes