1

I'm trying to add attributes (in excel format) to an existing shapefile using ArcGIS, but the number of records between the two are not the same; there are some records in one file but not in the other, and vice versa. I'm new to GIS field and not sure what steps to take, but here's what I think will work:

  1. Export attributes from shapefiles to database format, convert it to excel format
  2. Merge shapefile attribute with the other excel attribute to form one file
  3. Retain those from shapefile attribute
  4. Import new data back to the shapefile

Do you think this will work? Especially at step 4, can I import new data (i.e., with updated attributes) in the excel form to the shapefile in some way? Sorry if it's looks too rudimentary/crude a plan, but to my beginner level that makes some sense intuitively.

EDIT:

  • The reason I think I have to use Excel is because the ID field (FID) is available in the shapefile but not in the Excel. What they have in common is the description of the FID; in this data, the descriptive fields include county, district, and province. In addition, these descriptive fields are collectively unique but not individually unique; that is, it may be that some counties have the same name, but they belong to different districts (or even the same district but different provinces). So what I can think of is to export data and work on Excel, or whatever external program (a statistical one will do), to assign FID to the additional attribute table, before joining/relating them. But does ArcGIS allow joining/matching using more than one ID fields?

  • The relationship is one (of the shapefile) to many (of the additional attribute table). How does it complicate the joining/relating plan?

  • 1
    I would not go back into Excel with anything. While you've established that both tables have records the other might not, you haven't said what the relationship between the two tables might be. If one-to-one, a join as suggested by current answers will suffice. Records in the table but not in the shapefile will result in Null Geometry records in the result, which can be fixed with replace geometry. If the relationship between the two tables is one-to-many or many-to-many, you may need the Make Query Table tool. – Chris W May 14 '15 at 1:10
  • 1
    If you don't have a common field between the two, then a join won't work. If you can manipulate fields in either to create a new field such that they do have common values (concatenate fields), you can get around that. Otherwise you would need to use the Make Query Table tool, which does allow using multiple fields for a key. The one-to-many nature of the join/query means if a shape has more than one matching row, that shape will be duplicated for each matching row and you get stacked polygons. – Chris W May 14 '15 at 7:03
  • Thanks for your helpful comments. My capacity in programming is almost none, so at this moment I'll get around the Query Table by reshaping/transposing the attribute data to make it possible for one-to-one matching to get an idea of basic GIS analysis. – NonSleeper May 15 '15 at 0:16
1

There are three easy methods to join data using ArcGIS:

If you have shared keys between the two feature classes, and attribute fields already exist, you can use a table Join to "merge" the attribute tables. You have the option to do an inner or outer join. This join is stored in memory while ArcGIS is running. If you want it to persist you can export the feature class after the join.

If you have shared keys but the attribute fields do not already exist, you can use Join Field which will append the fields to your existing table. The result of this operation is permanent

If you do not have shared keys but want to join based on spatial relationships, you can use a spatial join. Results from this operation depend on the quality of your spatial data.

  • Thanks for your answer, I'll figure it out from these suggestions. Should there still be a concern regarding number of records between the shape file's attributes and additional attributes being not the same? Or that will be taken care of appropriately with one of these join features? – NonSleeper May 13 '15 at 16:25
  • Outer Joins are not sensitive to the number of rows in the join table. when joining A to B using an outer join (Keep All), the resulting table will keep all rows from A and if the row value doesn't exist in B, will show Null values from B. When using an inner join (Keep Common), rows from A that don't exist in B will be excluded from the resulting table, so in this case it will matter. Please review the ArcGIS documentation and wiki – Ben S Nadler May 13 '15 at 17:15
0

A simple outer join would do. And what do you mean by number of records are not same. Do you have any new points or points missing in the second table? Whatever it is is the priority should be your records of first table and attributes of second. So table 1 outer join table 2..so that you can have all the records from table1 and matching records from table 2. You can do this directly on shape file in qgis or arcgis .

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.