Saturday, 16 February 2019

arcgis engine - IPoint -> Nearest Address


Summary: How to use the MDB file (link below) as a locator to reverse geocode (point->address) with ArcMap?


I've implemented this sample: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/How_to_find_the_address_closest_to_a_point_using_reverse_geocoding/0001000001n9000000/


The sample works with a file ESRI provided, Atlanta.mdb, and with DataMaps10 US Streets locator.



I am trying to get my own MDB files to work. I can do the following with them:


//Address -> Point 
//Address -> Closest Address Match
//Point -> Nearest intersection
//Intersection -> Point

I can't get Point -> Address to work.
I don't know how to identify the problem. I project my IPoint coordinates to the projection of the MDB, but that doesn't work. I've tried everything I can think of. Can you give me some ideas of things to try to isolate the problem? I have a temporary license for ArcMap for another week, so I can use that to help. I'm using ArcEngine 10, C#, & VS 2010.


Edit:


I've uploaded a zip file here: http://www.filedropper.com/roads



It has an MDB, a shapefile and a projection. I used the shapefile to create the MDB file.


I need to know how to reverse geocode this MDB file. I need to just one more operation:


//Point -> Nearest Address 

I would like to do it programmatically, but if you tell me the steps to do it in ArcMap, then I will have a decent idea how to implement it programatically, and that will be good enough.


To summarize: How to use the MDB file as a locator to reverse geocode with ArcMap?


Edit #2: When I implement the sample here: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/0001000001n9000000.htm


There is this line of code:


IPropertySet addressProperties = reverseGeocoding.ReverseGeocode(point, false /*return intersection */);


If the second parameter, return intersection == true, then it works. But if the second parameter is equal to false, it throws a COM error, 0x80040217, which corresponds to GEOCODING_E_REVERSE_GEOCODE_NO_ADDRESS_FOUND . I've tried a lot of different coordinates and I have my search radius equal to 1 km, so something should be found.


Edit #3:


I found this http://resources.arcgis.com/content/kbase?fa=articleShow&d=38314


Which points to this: 9.3.1 Locator Styles http://resources.arcgis.com/gallery/file/geocoding/details?entryID=12D8D400-1422-2418-34B0-4FE1CC06C0ED


I am hoping that I can get these 9.3.1 styles in the same way that the empirical programmer got it to work, and that might be a solution. If I can I'll post it, and give you the points empirical.



Answer



I downloaded Kirk's locator and tried using the house icon, and clicking on the map. I also don't get any addresses back ... don't really get why its not working in ArcMap 10.


So I exported the data out to a shape file then recreated a locator in 9.3.1 (US Streets style).


Then I opened the 9.3 locator up in ArcMap 10 with the original streets in the roads.mdb (from Kirk's download). Now using the house icon, and clicking on the map seems to work.


Not really a long term answer but if you just need to get this working for the moment the locator files are at http://www.filedropper.com/loc93.



HTH


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...