3. Need for Join…!
• Most database design guidelines promote organizing your database into multiple
tables — each focused on a specific topic — instead of one large table containing
all the necessary fields.
• Having multiple tables prevents duplicating information in the database, because
you store the information only once in one table.
• When you need information that isn't in the current table, you can link the two
tables together.
Tuesday, March 3, 2015Institute of Geology, University of the Punjab
3
4. With the help of ArcGIS
• ArcGIS allows to join or relate the records from a layer to a table etc.
• This can be done using a “Key” said to be the “Primary Key”.
• Joining can only be done, if one is having atleast one “Common Field” in both of
them.
• This is only temporarily.
• And it is stored only when one saves the Arc Map document. (.mxd)
• If one doesn’t store the Arc Map document, it will show NO join, next time opened
with the same file.
• Otherwise, “Export” the file with the records for being permanent.
Tuesday, March 3, 2015Institute of Geology, University of the Punjab
4
5. Tuesday, March 3, 2015Institute of Geology, University of the Punjab
5
Joining on the basis of
Common Field
6. Join in Arc GIS
• The input and target table should be either in the same directory or saved with
relative paths in order to establish the relationship on next opening of Arc Map.
• Otherwise, Repair the paths to re-new the relationship.
• The common field MUST have the “Same Data Type”.
• It is not necessary to have the same field name.
• It could have following relationships:
• One to one
• Many to one
Tuesday, March 3, 2015Institute of Geology, University of the Punjab
6
7. Tuesday, March 3, 2015Institute of Geology, University of the Punjab
7
Above:
One-to-one Relationship
Lower:
Many-to-one Relationship
8. Types of Join
• It could be join on the basis of:
• Non-spatial information (Attribute data)
• On the basis of common field or attribute data.
• With another layer or with table (Excel or Text file)
• Having common key or primary key.
• Spatial information (Locational data)
• All of the shapefiles can be joined with each other.
• Point to Line to Polygon (vice versa and within each other)
• All of the pairs are given different options.
• It will create new output file for every join.
Tuesday, March 3, 2015Institute of Geology, University of the Punjab
8
9. Options available within Spatial join of Data in Arc GIS
Tuesday, March 3, 2015Institute of Geology, University of the Punjab
9
10. Tuesday, March 3, 2015Institute of Geology, University of the Punjab
10
LEFT:
Attribute Data (From
table)
RIGHT:
Locational Data (From
another layer)
11. Managing & Removing Joined Tables
• Managing Tables
• Right-click a layer or table in the table of contents and click Properties. Click the
Joins & Relates tab.
• All the joins for the layer or table are listed on the left side of the dialog box. You
can add new joins, remove existing ones, and view properties about the joins.
• Removing Tables
• In the table of contents, right-click the layer containing a join you want to remove.
• You can also click the Options button on an open table window.
Point to Joins and Relates, point to Remove Join(s), and click the join you want to
remove.
Tuesday, March 3, 2015Institute of Geology, University of the Punjab
11
12. Tuesday, March 3, 2015Institute of Geology, University of the Punjab
12
Joins & Relate
13. Relate in Arc GIS
• One table can only be joined with one layer at a time.
• One can keep:
• All Records, or (Default option)
• Only matching Records
• One can remove Join, anytime one wants.
• Join does not alter the original table.
• All the attribute operations are valid upon the fields that are joined together.
• As the joined table simply can be opened as “Attribute Table” in Arc Map.
Tuesday, March 3, 2015Institute of Geology, University of the Punjab
13
14. Tuesday, March 3, 2015Institute of Geology, University of the Punjab
14
Above:
Keeping all records
Lower:
Keep only matching records
16. • It only represents the relationship between two classes.
• Relate does not append the data to the layers permanently like join.
• It offers two relationships:
• One to many
• Many to many
• Relates are bi-directional. That means:
• Layer and table can be accessed cross each other.
• Table will be listed under the layer.
• Layer can be accessed by the table also.
Tuesday, March 3, 2015Institute of Geology, University of the Punjab
16
17. Tuesday, March 3, 2015Institute of Geology, University of the Punjab
17
How to Relate and Access it
18. Important Facts
• “Same Table” cannot be Relate to “Same Layer”, already Joined with that table.
• It will give error.
• Reverse can possible.
• “Same Table” can be Join to “Same Layer”, already Related with that table.
• During the “Join or Relate”, the table cannot save the edits on it. Unless it is
saved with another name.
Tuesday, March 3, 2015Institute of Geology, University of the Punjab
18
19. Tuesday, March 3, 2015Institute of Geology, University of the Punjab
19