Building relationships for Esri File Geodatabase

Tools and step-by-step instructions to merge LINZ Data Service (LDS) layers and tables into one Esri File Geodatabase, and create relationships within the database.

On this page

Introduction

Toitū Te Whenua provides sets of spatial layers and tables for the simplified Property and Ownership datasets on the LINZ Data Service. Some of the spatial layers in this dataset relate to the table (non-spatial) records by attribute association. If you are using a GIS system, Esri File Geodatabase relationships can help you search or visualise spatial features while being able to query related table records to provide additional descriptive information.

To best support Esri customers, Toitū Te Whenua provides tools to merge layers and tables into one database, and create relationships within this.

See the Koordinates Help site for information on their File Geodatabase implementation.

Download the LDS Esri tools software

Toitū Te Whenua provides an ArcGIS Python ArcToolbox download that can also be used as a command line tool.

Requirements:

  • Version 10.1 or higher is required to run the function from within ArcGIS.
  • Version 10.0 or higher is required to run the function as a command line tool ArcGIS.
  • An ArcEditor product license is required to create relationships.

Download the software

LDS Esri Tool at GitHub

LDS ArcGIS Python ArcToolbox (ZIP 6KB)

This download contains the lds_merge_property_data python script. The software is released under the terms of a BSD license. See the license file within the download for more information.

LDS layers for merging and relationships

The tool will support merging and building relationships for any of the following datasets:

Relationships created

Below is a diagram showing the relationships that this software can create.

Diagram of software relationships

Getting the data from LDS

Before running the tool you must get the data from the LDS.

1. Visit the LINZ Data Service and download layers and tables as a File Geodatabase export.

2. Unzip the download. It’s best to do this on a local disk for the best processing performance. This directory should have a layout like the one below:

File Directory IDs image

Using ArcToolbox to run the tools

3. Once you have downloaded the LDS Esri Tools software, unzip the lds_merge_property_data.pyt file and save it to a local drive.

4. Open the file in ArcCatalog. The ArcToolbox provides 2 tools which can be run separately or chained together into a batch operation. These tools are described below.

ArcCatalog browser screenshot

LDS merge property datasets

5. Run the LDS merge property datasets tool.

6. Select the directory of unzipped LDS File Geodatabases, each containing a single layer or table, as above.

7. Select the destination File Geodatabase for the layers and tables to be imported into. This must be an existing database. If you need a new database click 'New File Geodatabase' in the browse folder dialog.

ArcCatalog merging datasets screenshot

8. Click OK. Each layer and table in the directory will be imported into the destination File Geodatabase. Note that this may take up to an hour to process.

LDS relationships builder for property datasets

The LDS relationships builder for property datasets tool can be used to create relationships between the property and ownership data for an already merged File Geodatabase. This tool takes the simple input of an existing File Geodatabase. Note that if you want to create relationships you need to have an ArcEditor product license.

9. Select the LDS File Geodatabases with all of the layers and tables. (This was the output of the previous tool.)

ArcCatelog relationship builder image

10. Click OK. The layer and table relationships will be added to the File Geodatabase. Note that this may take up to an hour to process.

Using the python command line to run the tool

1. Download the LDS Esri Tools software, unzip the lds_merge_property_data.pyt file, and save it on your computer.

2. You can run the script from a command line dialog using the following syntax:

Usage: lds_merge_property_data.pyt [options] source_lds_dir destination_file_gdb

Options:
-h, --help show this help message and exit
-o, --overwrite overwrite destination FileGDB
-r, --relationships creates relationships between features class and tables

Unlike running the tools in ArcToolbox, if the destination File Geodatabase does not exist the script will automatically create a new one for you.

Below is an example which merges tables and layers into a single File Geodatabase, as well as creating the relationships.

C:\Python26\ArcGIS10.0\python.exe lds_merge_property_data.pyt -r C:\Temp\working\data
C:\Temp\working\lds_property.gdb

In this case:

  • C:\Python26\ArcGIS10.0\python.exe is the path to ArcGIS’s implementation of the python executable which will run the script
  • C:\Temp\working\data is the directory where the LDS exported File Geodatabases have been unzipped to
  • C:\Temp\working\lds_property.gdb is either a new or existing File Geodatabase which will contain the merged data and created relationships
  • The “–r” option has been provided to build the relationships.

Note that this may take up to an hour to process.

Relationships in action

This is a screenshot of ArcMap Feature Identify Tool in action using the File Geodatabase which has been processed by the lds_merge_property_data tool:

ArcMap Feature Identify Tool screenshot

It shows the selected parcel polygon (Lot 2 DP 50792, Wellington) and the related tabular data which includes Statutory Actions, Survey Plans, Titles, Title Estates and Title Owners.

Support

For any technical assistance please contact the LDS team at linzdataservice@linz.govt.nz

For any software fault please record an issue on the LDS Esri tools page on GitHub.

 

Last updated
Last updated