I am trying to open a address locator in ArcObjects by following this tutorial: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Creating_an_address_locator/0001000004pm000000/

The code sample has this line: String workspacePath = @"C:\UnitedStates.gdb";

I talked to an analyst and they told me to find the sample in this folder "C:\Program Files\ArcGIS\DeveloperKit10.0\Samples\data\Usa"

And that has a file called USA.gdb

However my "USA Base Map.mxd" file is located here, Z:\ESRI\DataMaps10\usa

It seems like ArcEngine should use the same map / data to do both geocoding and projections... right? Am I doing something obviously wrong?

2 Answers 2


The geoprocessing tool takes a path to a GDB file as input but it should also be able to take a FeatureClass as input:

Misstatement—Geoprocessing tools only take datasets on disk as input and only write datasets to disks. Another way this has been stated is that geoprocessing is "pathname to pathname" only. Only pathnames to datasets can be used as input and output parameters. In fact, you can use equivalent ArcObjects anywhere features classes are expected. For example, you can do the following: Pass an object with IFeatureClass or IDataset as input to a tool instead of a pathname string. Create in-memory feature classes, manipulate them, and use them in geoprocessing tools. Use the special in-memory FeatureSet and RecordSet objects instead of feature classes and tables. These two objects behave like their on-disk counterparts.

Geoprocessing misstatements So I guess you should be able to get a FeatureClass from your map and pass it as an in-parameter to the geoprocessingtool.

  • Any idea how to get a featureclass from my map?
    – patrick
    Sep 7, 2010 at 15:11
  • On the IMap object you have a ILayer layers collection, search for you layer in that collection. When you find your layer cast it to a IFeatureLayer it has a FeatureClass property. Sep 7, 2010 at 17:40

apparently this is normal. The geodatabase is not in the same dir as the ISO maps. I think my GDB is still corrupt tho

  • 1
    Correct! The MXD has a datasource that could be a GDB or shapefile somewere else on your machine or mayby even a server layer. If you open the MXD in ArcMap you should be able to see what datasource is's connected to. I haven't seen any resources on what datasources that are valid. Sep 8, 2010 at 5:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.