AnsweredAssumed Answered

Getting Address Candidates for one feature in Java/ArcObjects

Question asked by rohneas on Aug 2, 2012
Latest reply on Aug 2, 2012 by rohneas
I'm writing a custom toolset using Java and ArcObjects.  One of the things I am trying to do is fix geocoding errors one-by-one.  I would like to get a table of address candidates, but I am having trouble.

My code (the relevant portion is below).

ILocatorManager locatorMgr = new LocatorManager(); ILocalLocatorWorkspace locatorWs=new ILocalLocatorWorkspaceProxy(locatorMgr.getLocatorWorkspaceFromPath("T:\\GIS\\Staff\\Rohne\\TOBS\\OKIData.gdb")); ILocator locator=(new com.esri.arcgis.geodatabase.ILocatorWorkspaceProxy (locatorWs)).getLocator("Compositeocator"); IAddressGeocoding addressGeocoding=new com.esri.arcgis.location.IAddressGeocodingProxy (locator); IPropertySet addressToMatch = new PropertySet(); IPropertySet addressMatched = new PropertySet(); addressToMatch.setProperty("Street", Address); //Address, Zip, Placename, City, and State are set prior to  addressToMatch.setProperty("Zone",Zip);        //this point. addressToMatch.setProperty("Name",PlaceName); addressToMatch.setProperty("City",City); addressToMatch.setProperty("State",State); addressMatched=addressGeocoding.matchAddress(addressToMatch); //This DOES work, but I only get one address ITable regcT=new com.esri.arcgis.geodatabase.ITableProxy (addressGeocoding);  //unused IFields fields=addressGeocoding.getMatchFields();  //used further down the script //works to here //IAddressCandidates addressCandidates = new IAddressCandidatesProxy(); //works //IArray addressCandidateArray=addressCandidates.findAddressCandidates(addressMatched); //<~ does not work IArray addressCandidateArray=new IAddressCandidatesProxy().findAddressCandidates(addressMatched); //<~ does not work


Can anyone get me pointed in the correct direction?

Thanks!
Andrew Rohne
OKI Regional Coucil

*Edit: removed indents in code to make it more legible

Outcomes