Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

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.

share|improve this answer
    
Any idea how to get a featureclass from my map? –  patrick Sep 7 '10 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. –  MathiasWestin Sep 7 '10 at 17:40
add comment

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

share|improve this answer
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. –  MathiasWestin Sep 8 '10 at 5:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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