3

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

I have two shapefiles. One is a point shapefile Called Addresses and another Polygon shapefile which is called Area. The Address shapefile has an attribute called Address_Number while the Area shapefile 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 shapefile.

How can I do this?

Any help with some code example is greatly appreciated.

  • 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
1

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.

  • 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
0

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.

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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