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.

Newbie in arcobject programming. Using C#. Developing a desktop application.

I have 2 shape files. One is a point shape file Called Addresses and another Polygon shape file which is called Area. The Address shape file has an attribute called Address_Number while the Area shape file has a attribute called Area_Number. I need to select only the features that match "Address_Number" (from Addresses) to "Area_Number" (from Area) and then create a new shape file.

How can I do this?

Any help with some code example is greatly appreciated.

share|improve this question
    
In which direction do you want the join to be performed? The resulting shapefile can also have only one geometry field, either from the Address point or the Area polygon. –  Petr Krebs Jan 12 '11 at 17:44
    
In fact, are you really trying to perform a join? It sounds as if you are actually trying to export only a subset of one table. –  Petr Krebs Jan 12 '11 at 17:59
    
Resulting table should be a point geometry (Address point). Well actually I want to select only the features that match "Address_Number" (from Addresses) to "Area_Number" (from Area) and then create a new shape file and get the AreaName into the new point shape file. Any code help would be greatly apprciated –  user1506 Jan 12 '11 at 20:22
add comment

2 Answers

join the dbf from the area shape with a many to one, to the addresses shape. select the oid of area not null and export.

share|improve this answer
    
Sorry not sure how to do this. Can you give me some code example on how to do this? Thanks –  user1506 Jan 11 '11 at 1:00
    
I apologize, I am not a programmer. I just know the steps I would use. –  Brad Nesom Jan 11 '11 at 3:07
add comment

EDIT: The text below assumes you want to perform an actual join, i.e. create a table containing fields from both source tables.

Since the two tables are in different data sources, you cannot perform a database join to do this. If you do not want to write code to do the join manually, you will need to use IRelQueryTable along with an MemoryRelationshipClass. Both objects can be instantiated using their factories - IMemoryRelationshipClassFactory and IRelQueryTableFactory. This will give a table which you can export anywhere you like.

share|improve this answer
    
Thanks for the reply. Tried your steps but it failed. Looks like I'm doing something wrong. Any code help would be greatly appreciated. –  user1506 Jan 12 '11 at 20:25
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.