Join Many

Joins a table to a feature class based on a common field to create a new feature class that contains one feature for each match. It supports one-to-many relationships.

For example, if five records in the table match one feature in the input feature class, then five copies of this feature will be copied to the output feature class. The attributes from both the input feature class and the table are retained in the output feature class.

In this way the tool can be used to create an output shapefile that mimics a regioned coverage.

Usage Tips

JOINMANY was written because the ADDJOIN tool (in Data Management Tools) does not support one-to-many relationships.

There is no equivalent of a regioned coverage in the new ArcGIS data model. However ArcGIS feature classes may contain overlapping features. JOINMANY takes advantage of this to create a poor-man's equivalent to regions. (JOINMANY can also be used with POLYLINE and POINT features.)

Querying the results: You can perform a query on the attributes of the output feature class the same as always. If two overlapping features meet the query criteria, then both features will be selected. If it is not desirable to have overlapping features in the query results (for instance when you don't want to double count areage), then you can eliminate the overlapping features using the DISSOLVE tool (in Data Management Tools).

Displaying the results: Setting the output layer's transparency won't help you detect overlapping features. (Features are only transparent relative to features in another layer.) However, you can symbolize a polygon layer using transparent fill patterns, such as a hatched line fill or transparent dot fill. This way you can identify several layers of overlapping features.

Identifying the results: You can use the Identify tool (on Tools Toolbar) to identify the feature as always. When you click on overlapping features, the attributes for one of the features will be displayed in the right panel of the Identify Results window. However each overlapping feature is added to the left panel of the window, and you can click on any one of the features to display its attributes in the right panel.

JOINMANY is slow. If this is a problem, contact the developer.

Command line syntax

joinmany <in_shapefile> <in_field> <join_table> <join_field> <out_shapefile>

Parameters

Expression Explanation
<in_shapefile>

The input shapefile.

The shape type of the input features can be POINT, MULTIPOINT, POLYGON, or POLYLINE.

<in_field>

The field within the <in_shapefile> on which the join will be based.

<join_table>

The input table that is to be joined to the <in_shapefile>.

<join_field>

The field within the <join_table> on which the join will be based.

<out_shapefile>

The name for the output shapefile that will contain the results of the join.

Only features that have a corresponding record in the <join_table> will be copied to the <out_shapefile>.

Features that have multiple corresponding records in the <join_table> will have one copy written to the <out_shapefile> for each corresponding record.

The attributes from both the <in_shapefile> and the <join_table> will be retained in the <out_shapefile>. When a field in the <join_table> is named the same as a field in the <in_shapefile>, then the field from the <join_table> will be rename with a numeric extension (e.g. PLOT_ID becomes PLOT_ID_1) in the <out_shapefile>.

Command Line Example

joinmany stands.shp suid activities.dbf suid stand_activities.shp
Executing (joinmany_2): joinmany "C:\Documents and Settings\dchatfie\My Documents\facts\stands.shp" suid "C:\Documents and Settings\dchatfie\My Documents\facts\activities.dbf" suid "C:\Documents and Settings\dchatfie\My Documents\facts\stand_activities.shp"
Start Time: Fri Apr 14 19:17:47 2006
Running script joinmany...
Joining table to feature class...
Maximum number of passes: 6
Pass 1...
Pass 2...
Pass 3...
Pass 4...
Pass 5...
Pass 6...
Completed script joinmany...
Executed (joinmany_2) successfully.
End Time: Fri Apr 14 19:20:00 2006 (Elapsed Time: 133.00 secs)

Scripting syntax

joinmany (in_shapefile, in_field, join_table, join_field, out_shapefile)

Parameters

Expression Explanation
in_shapefile (Required)

The input shapefile.

The shape type of the input features can be POINT, MULTIPOINT, POLYGON, or POLYLINE.

in_field (Required)

The field within the <in_shapefile> on which the join will be based.

join_table (Required)

The input table that is to be joined to the <in_shapefile>.

join_field (Required)

The field within the <join_table> on which the join will be based.

out_shapefile (Required)

The name for the output shapefile that will contain the results of the join.

Only features that have a corresponding record in the <join_table> will be copied to the <out_shapefile>.

Features that have multiple corresponding records in the <join_table> will have one copy written to the <out_shapefile> for each corresponding record.

The attributes from both the <in_shapefile> and the <join_table> will be retained in the <out_shapefile>. When a field in the <join_table> is named the same as a field in the <in_shapefile>, then the field from the <join_table> will be rename with a numeric extension (e.g. PLOT_ID becomes PLOT_ID_1) in the <out_shapefile>.

Script Example

# Import modules.
import sys, string, os, win32com.client, joinmany

# Create the Geoprocessor object
gp = win32com.client.Dispatch('esriGeoprocessing.GpDispatch.1')

# Load required toolboxes...
gp.AddToolbox('C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Analysis Tools.tbx')

# Load DV Data Management Tools toolbox.
gp.AddToolbox('C:/Documents and Settings/dchatfie/Application Data/ESRI/ArcToolBox/My Toolboxes/' + \
                         'DV Data Managment Tools.tbx')

# Set workspace.
gp.workspace = 'c:/documents and settings/dchatfie/my documents/facts'

# Run joinmany script.
gp.joinmany('stands.shp', 'suid', 'activities.dbf', 'suid', 'stand_activities.shp')