This tool allows you to spatially compare two layers and then create a new table which will contain data from first layer (master) updated by data from the second layer (detail).
Spatial Merge tool contains 5 sections:
- Here you can select a master layer. The master layer is a main layer. All columns from this layer table will be copied to newly created output table.
- Here you can set a detail layer. The detail layer will take part in comparison process and selected data from this layer table will be used and placed in the newly created output table.
- In this field you can select one of the spatial comparison methods.
- In the Columns to append from detail layer field you can select which data from the detail layer should be placed in the Output table.
- Here you can enter the Output table name and Repository in which the new table should be created. If the entered table name already exist the spatial merge operation will be disrupted.
How to use Spatial Merge tool
To explain how this tool works and how to use it we will use 2 layers: Tourist symbol and National Parks. Both these tables are part of Ordnance Survey Strategi dataset and are available for free from OS website under OS OpenData licence.
- Tourist symbol – this layer stores information about tourist attractions. This is how it looks in database:
The Tourist symbol layer table contains 8 columns:
- CODE
- LEGEND
- AMENDED
- NAME
- USAGE
- OWNER
- ORIENT
- MI_PRINX
- National Parks – this layer stores names and details of United Kingdom national parks.
In this example we will use Spatial Merge tool to create a table with all information from the Tourist symbol layer extended by additional column which will store a name of National Park in which the windmill is located.
We click on the Spatial Merge tool icon.
In the Spatial Merge tool window we’ve set everything to create a new table. You can find a detailed description below.
- Tourist symbol – because we want to copy all data from the Tourist symbol layer table to newly created output table we set it as master layer.
- National Parks – this layer stores the National Park names. We set is as detail layer.
- Because we know that some tourist symbols are located inside National Parks records we’ve selected which intersect with master record comparison method.
- We want to add a column which will store a name of National Park. We know that the names are stored in NAME column so we check it.
- SM_Tourist_Symbol – this is a name of the Output table.
When everything is set, we can click OK button to confirm all settings and move to the next step. Save Spatial Merge Layer window will appear. Please set a name and select the location for the new layer. To start the operation please click the OK button.
When the operation is finished – newly created layer is automatically added to the currently opened map.
This is how the newly created SM Tourist symbol layer looks in Table tab:
As you see the table stores the data and the location of all records from Tourist symbol table. Please also notice that the NAME column name from the National Parks is changed to NAME2. That happened because the Tourist symbol table already contained a NAME column and Earthlight is automatically updating new columns names if it detects an already existing one.