Merge
The Merge tool replaces the manual routine of concatenating each file pair, reconciling field differences and rebuilding the database by hand. Using the default settings for the tool, the merge process operates at hole level and introduces no validation error not already present in one of the source databases. Neither input database is modified, and errors already present in a source are preserved rather than repaired.
Use Merge Drillhole Databases to:
-
Combine the database from a previous drilling campaign with the database for the current campaign.
-
Fold the drillhole data from an acquired project into your own database.
-
Merge a data set from a joint-venture partner with yours.
-
Add a new batch of holes to a validated a master database.
Databases
The Primary Database and Secondary Database options are used to specify the drilhole databases to be merged.
Primary Database
Double click (F3) or use the icon in the Database field to select the database whose setup you want the merged database to keep.
The primary database structure - key-field mappings, desurvey options (method and azimuth correction), collar attributes and display options - are all inherited by the merged database output.
In the Label field, enter a value to be written to the source database field for every record that comes from that database. This field defaults to the name of the database. Enter a different name if this is not the label you want written to the merged database.
Optionally, you can select the Filter option and select or create a filter to be applied to the primary database to be merged.
Secondary Database
Double click (F3) or use the icon in the Database field to select the second database to merge. The records from the Secondary database are written into the structure of the Primary database.
In the Label field, enter a value to be written to the source database field for every record that comes from this database. This field defaults to the name of the secondary database. Enter a different name if required.
Optionally, you can select the Filter option and select or create a filter to be applied to the secondary database to be merged.
Note: The Secondary Database is compulsory. An existing, empty database can be selected, but the selection cannot be omitted.
Files
The Files grid in the Merge Drillholes Database form lists the files contained in one or both nominated databases. When the grid is auto-filled, it will display one row per file pair, or per file present in only one of the two databases.
The Autofill the grid button in the Files grid will reapply the automatic pairing of Interval and Event rows by file name similarity and field overlap.
Include
The Include option, when selected, indicates that the files displayed in the row will be used in the merge. If the option is not selected, all files in the row are omitted from the merged database. Any files not included will be noted in the report.
Note: The Collar file row is read-only and selected by default.
File Type
The File Type option displays file type for the row - Collar, Survey, Interval or Event.
The Collar and Survey rows are created and paired automatically from the nominated Primary and Secondary databases. The Collar field is locked.
Interval and Event rows are paired automatically, by file-name and field matches.
Primary / Secondary
The Primary and Secondary columns in each row display the paired input files from the databases. Where a file is only contained in one database, the alternate column in the row will be left blank; and passed to the merged database with records from its own source only. These pairings are automatically assigned by the application.
To modify a pairing, select a different file from the drop down in the empty column. This drop down displays the unpaired files of the same type from the database with the missing value You can also clear a pairing to produce two single-source rows.
Note: Interval files only pair with interval files, and Event files with Event files.
Preference
Select Primary (default) or Secondary from the drop down in the Preference field to specify the preferred file for record selection when a hole exists in both files of the pair.
You can set this per pair, so one pair can keep the records from the Primary database while another keeps the Secondary database records.
This setting only applies when Avoid validation issues in the Options group is selected.
Output file
Double click (F3) or use the icon in the Output file field to specify the name of the file to which the information from the row will be written.
This value defaults to the name of the primary file with the File prefix and File suffix values from the Output section applied. For secondary-only rows, the Output file name defaults to the name of the secondary file.
More…
The More button opens the Field Matching dialog for each row. From the dialog, you can configure the fields to be written to the output for the row; as well as match the Primary and Secondary fields.
The Field Matching dialog lists the key-fields for each file type as read-only.
Include
The Include option, when selected, indicates that the information in the Files grid row will be written to the nominated Output file.
Where the field on the row exists in only one of the two database sources, it will be left blank in the records from the alternate source. If Include is not selected, the information on the row will not be written to the output file.
Output Field
The name of the field to be written to in the Output file is displayed in the Output Field column. This value defaults to the name of the field in the Primary database, or to the name of the field in the Secondary database for secondary-only fields. You can edit the Output Field name if required.
Primary / Secondary
The Primary and Secondary columns display the source field to be written to the Output file from the merging databases. Fields whose names match exactly are automatically paired with a Primary and Secondary field. No partial matches are made or attempted.
You can pair any unmatched fields manually using the drop down containing unmatched Secondary fields.
Manual field pairing offers all non-key secondary fields, as well as unmatched ones. If a field is mapped twice, it will be rejected as a duplicate.
Write source database field to this file
Select this option to override the Write source database field option in the Merge Drillhole Databases dialog for the file. If the Write source database field to this file option is selected, the source database field is written to this output file. If this option is not selected, the Merge Drillhole Databases setting is applied.
Options
The Options in the Merge Drillhole Databases form are used to configure the validation, record handling and sort behaviour of the process.
Avoid validation issues
This option is elected by default and will process any conflicts at hole level, making the merge structurally safe.
When the Avoid validation issues option selected, if a hole exists in both files of a pair, all of the records for that hole are taken from the preferred file for the pair (specified in the Preference column) and records from the other file for the hole are rejected as a set.
Duplicate collars are resolved in the same way. Any hole which does not appear in any of the merged collar records is rejected rather than written as an orphan. Records are never merged within a shared hole, so every hole in the merged database contains records from one source; guaranteeing the merge introduces no new validation errors.
If the Avoid validation issues option is not selected, each pair of files is concatenated directly (primary records then secondary records) without checking for duplicate holes or any overlap. Field matching, structure reconciliation and the source database field still apply; but no records are rejected and any conflicts pass through to the merged database. Validation issues introduced this way will be detailed in the validation summary of the post merge report.
Filter-excluded holes are rejected and written to the rejected files even when Avoid validation issues is not enabled. Filters apply in both modes.
Write source database field
If you select the Write source database field option, you can specify a Field name to be added to each Output file, filled with the value from the Label for the record in the database. This will identify the origin of every record after the merge.
When the option is not selected, no source field is written to the merged database.
Note: This option can be overridden for any file using the Write source database field to this file option in the Field Matching dialog.
Sort by hole and depth
Select the Sort by hole and depth option to sort each output file by Hole ID and then From/Depth, matching the order in which a new database is created. No sorting is applied if the option is not selected.
Remove blank records
If you select the Remove blank records option, blank records are removed from the output files. If the option is not selected, they are written to the merged database.
Output
The Output options in the Merge Drillhole Databases form are used to configure the details for the merged database output file and the generated report.
Database
Enter a value or use the ellipsis in the Database field to specify the name of the merged drillhole database.
All output files are written to the same location as the database file. To create the database in a project sub-folder, prefix the name in the Database field with the sub-folder path (e.g. MyFolder\database).
The Output database is a copy of the Primary Database definition. Desurvey options, collar attributes and display options will be carried over. If no survey row survives, the survey definition is removed.
File Prefix / File Suffix
Use the File Prefix and File Suffix fields to enter the text added to the front and to the end of each default output file name, following the same convention as the Subset tool.
The File Prefix value is compulsory and no default is supplied. If you leave the File Prefix blank, an error will occur.
Write rejected records to files
Select the Write rejected records to files option to write every record that was rejected during the merge to a file alongside its output file; named with the specified File Suffix.
If the Write rejected records to files option is not selected, no files are written for the rejected records and any rejections are recorded in the report only.
Writing rejected records to files ensures nothing is discarded without you knowing what it was.
Reject reasons are Duplicateand Filtered. The Duplicate category includes both duplicate hole and shared-hole precedence cases.
Note: Any sub-folder named in the output must already exist.
Report file
Enter a name or use the icon in the Report file field to specify a name for the merge report (.RPT)
Run
Click Run to run the Merge Drillhole Databases process. The merged database is created as configured and saved to the specified .dhdb file. The merge report that is generated can be opened in the Report Viewer.
The merge report features the following columns:
-
File - Displays the name of the file or context for the report row. For file-level rows, the output file name is displayed (such as AAAA_COLLARMRG.DAT above). Section labels can also be displayed such as SUMMARY which displays the date and time of the run in the Notes column; or PRIMARY which displays the Primary database path.
Database file names contained in the File column will display the Primary, Secondary, Output and Rejected hole counts in the row for the first occurrence. The repeated files listed are field-mapping rows.
-
Primary - Shows information for the Primary database. For a row which contains output file details, it displays the number of holes contributed by the Primary database file.
-
Secondary - Shows information for the Secondary database. For a row which contains output file details, it displays the number of holes contributed by the Secondary database file.
-
Output - Displays the result for the merged output file. For a row which contains output file details, it displays the total number of records written to the output file.
-
Rejected - Displays the number of records rejected during the merge for the output file. Rejections can include duplicate or filtered records.
-
Notes - The Notes column displays descriptive details for the row; including database paths, labels, filters, selected options, output names, field mappings, promoted field types or widths, and rejection or validation information.