Tabular Join
The Tabular Join process will combine spatial data with a table to create a file at the census tract level that contains information about a specific region and its demographics. For a tabular join to work a field in the spatial data and the table must have the same values and formatting type (i.e. either numbers or text). Formatting the data is critical to this process, in this example prior to executing the joining script; a new column was created to insure that both data sets were in the same data format. The process could have also been done in the Python script, but it is beyond the scope that has been taught up to this point. The tabular data was downloaded from the U.S. Census Bureau initially. There are numerous locations to obtain the spatial data, which also includes the U.S. Census Bureau.
|
- The first three lines of functional script loads arcpy, the environment and sets the workspace to the KY1 geodatabase.
- The Join Field command has four variables; notice the command is located in the management toolbox.
- The first parameter is the name of the spatial data file
- The second parameter is the field from the spatial data file that will be used to accomplish the tabular join.
- The third parameter is the name of the table to be joined to the spatial data file.
- The fourth parameter is the field in the table, which contains the same data as that in the shapefile and is of the same format type.
- At this point, there is not an output file location. Remember, when doing a tabular join in Esri ArcMap, that the resulting file must be exported to make the results permanent. If exporting is not completed, then the tabular join will be lost when the project is closed.
- The CopyFeatures command creates a new feature class file, which will contain the spatial demographic information. The command is located in the management toolbox. A string variable named output was created which contains the name of the new output file, this step is not required and the name could have been added directly into the command line. The spatial data file is specified so the command knows where to get the information that will create the final output file (feature class file).
- The output file name uses the geographical location of the data and the demographic type, which was income. The number one was added since there was already a file in the author’s geodatabase with the same name.
- Open the output file and explore in ArcMap.