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 fields:
- 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 createdoutput 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. 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: Windmills and District Borough. Both these tables are part of Ordnance Survey Strategi dataset and are available for free from OS website under OS OpenData licence.
- Windmills – this layer stores information about windmills. This is how it looks in database:
The Windmills layer table contains 5 columns:
- CODE
- LEGEND
- AMENDED
- NAME
- MI_PRINX
- District Borough – this layer stores names and details of United Kingdom districts.
In this example we will use Spatial Merge tool to create a table with all information from the Windmills layer extended by additional column which will store a name of District Borough 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.
- Windmills – because we want to copy all data from the Windmills layer table to newly created output table we set it as master layer.
- District Borough – this layer stores the district borough names. We set is as detail layer.
- Because we know that all windmills are located inside District boroughs records we’ve selected which intersect with master record comparison method.
- We want to add a column which will store a name of District Borough. We know that the names are stored in NAME column so we check it.
- SM_windmills – this is a name of the Output table.
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.
In this case Spatial Merge operation took around 10 seconds. The operation time depends on the layers size and amount of stored data.
When the operation is finished – newly created layer is automatically added to the currently opened map.
This is how the newly created SMwindmillsNew layer table looks:
As you see the table stores the data and the location of all records from Windmills table. Please also notice that the NAME column name from the District Borough is changed to NAME2. That happened because the Windmills table already contained a NAME column and Earthlight is automatically updating new columns names if it detects an already existing one.