Working with Geodatabase Metadata: Writing/Updating Metadata

Liz Sanderson
Liz Sanderson
  • Updated

Introduction

A metadata record is a file of information - usually presented as an XML document - that captures the basic characteristics of a data or information resource. Geospatial metadata is used to document geographic digital resources such as Geographic Information System (GIS) files, geospatial databases, and earth imagery.
A geospatial metadata record includes core library catalog elements, such as Title, Abstract, and Publication Data; geographic elements, such as Geographic Extent and Projection Information; and database elements, such as Attribute Label Definitions and Attribute Domain Values.

Reading Geodatabase Metadata

Reading geodatabase metadata is triggered by setting the geodatabase reader parameter, Feature Read Mode, to 'Metadata'. When reading metadata, the reader feature types have a completely different schema than when reading features. Instead of listing user attributes, a metadata feature type lists a number of metadata fields, including geodb_metadata_string (an XML string containing the geodatabase metadata), while other format attributes store information such as dimension, spatial column, geometry, etc.

In metadata mode, only a single feature is output from the feature type. This means that to read features and metadata, you need two geodatabase readers: one to get the features and one to get the metadata.

Writing Geodatabase Metadata

Writing metadata occurs when a feature of the correct type is written to the table to which the metadata applies. A metadata feature must have the correct geometry type (i.e., have the geodb_type format attribute set to ‘geodb_metadata’), and the metadata being written should be held as XML in the format attribute - 'geodb_metadata_string'. It will overwrite any previously stored metadata on the table/feature class. If multiple metadata features are written to the same table, then the final feature is used.

Note that the destination feature type (table) should be that of the geometry type (point, polyline, etc.).

As of FME 2024.0, support for Esri ArcGIS Online (AGOL), ArcGIS Enterprise Portal, and ArcGIS Server Feature Service formats has transitioned to a unified approach using the new Esri ArcGIS Feature Service (Format). This format replaces the legacy reader/writer formats for each of the three services.

Starting in FME 2026.1, the legacy formats will be hidden in the Quick Add menu. Instead, equivalent functionality is now provided by the downloadable Esri ArcGIS Connector package, available on FME Hub. The package also includes new web services and key transformers such as the ArcGISOnlineConnectorArcGISAttachmentConnector, and ArcGISBranchVersionManager. The package can be installed directly through the Quick Add menu in FME Workbench. Once installed, the new Esri Feature Service format will appear in the Gallery as a unified method for interacting with all three types of Esri ArcGIS Feature Services.

For details on this transition, including guidance on updating existing workspaces, please refer to the article: Working with Esri ArcGIS Feature Services in FME.

Requirements

The Esri Geodatabase (File Geodb) reader/writer used in the following example requires that a licensed version of ArcGIS be available to the user. For more information on required ArcGIS license levels, please see Required ArcGIS License Types for FME Geodatabase Formats.

Source Data

BikePaths_L (Esri Shapefile)

BikePathsSource.png

BikePaths_L (XML Document)

XMLSource.png

In the above images, we see a visualization of the BikePaths_L shapefile and of a section of the BikePaths_L XML file.

Step-by-step Instructions

1. Read Source Data

Bike Path feature geometry is read from the source shapefile using the Esri Shapefile reader, while Bike Path metadata is read from an XML document using the XML (Extensible Markup Language) reader. These files will provide the features and metadata for the destination feature class. 

Open FME Workbench and start a blank workspace. Add an Esri Shapefile reader to the canvas and browse to the BikePaths_L.shp dataset, which can be downloaded from the Files section of this article. Since there are no other parameters to set, click OK to add the reader. 

ShapeReader.png

Next, let’s add the metadata. Add an XML (Extensible Markup Language) reader to the canvas, browse to the BikePath_L.shp dataset, and open the Parameters. 

XMLReader.png

In the parameters, click the ellipsis next to Elements to Match, then select metadata. Then click OK twice to add the reader. 

XMLParams.png

2. Define XML Feature as Metadata 

An AttributeCreator is used to create a metadata string attribute (geodb_metadata_string) that stores the incoming XML definition from the xml_fragment attribute. In addition, the AttributeCreator will also be used to define the destination geodatabase format as metadata. This is done using a format parameter (geodb_type) set to geodb_metadata. 

Add an AttributeCreator to the canvas and connect it to the metadata reader feature type. In the parameters, create the following attributes:

  • New Attribute: geodb_metadata_string
    • Attribute Value: xml_fragment
  • New Attribute: geodb_type
    • Attribute Value: geodb_metadata

Click OK.

AttributeCreator.png

3. Update XML Metadata

By looking at a section of the incoming metadata, we can see that a value indicating a minimum bike path length has not been applied.

DistanceSnippet.png

The XMLUpdater transformer will update the incoming metadata with a new value. Add an XMLUpdater to the canvas and connect both the Document and Update input ports to the AttributeCreator. In the XMLUpdater parameters, set the XML Text to geodb_metadata_string. Since there are many attributes, it is easiest to type them in rather than use the Attribute Selector. Next, in the Updates section, set the following values:

  • Update Type: Replace Contents
    • XML Path: /metadata/dataIdInfo/idPurp
    • Value Type: Plain Text
    • Value: Data for Bike Paths that are over 15 km long
  • Result Attribute: geodb_metadata_string

XMLUpdater.png

Basically, this transformer will take the metadata string, replace the chosen path with the new value, and write the new value back to the same attribute.

4. Combine Line Features

Now, let’s clean up the bike path line features as they are fragmented. Add a LineCombiner to the canvas and connect it to the BikePaths_L reader feature type. In the parameters, set the Combine On Attributes to PathId, PathName, and PathType, then click OK. 

LineCombiner.png

5. Calculate Path Length

Now that we’ve combined the bike path fragments into a single line per PathId, let’s calculate the new length. Add a LengthCalculator to the canvas and connect it to the LineCombiner. In the parameters, set the Length Attribute to PathLength and click OK. 

LengthCalculator.png

6. Write Features and Metadata

Now our data is ready to write out. Add an Esri Geodatabase (File Geodb)  writer to the canvas and specify the output geodatabase to which the data will be written (i.e., VancouverCity). Be sure that the Feature Class or Table Definition is set to Copy from Reader, then click OK. When prompted to select a feature type, be sure to select BikePaths_L [SHAPEFILE]. 

Writer.png

Once added, connect the output of the XMLUpdater and LengthCalculator to the BikePaths_L writer feature type. As an optional step, double-click on the geodatabase writer and, under General, rename the feature class/table name to "BikePaths". 

CompletedWorkspace.png

7. Save and Run the Workspace

Now, save and run the workspace. View the output geodatabase in Esri ArcCatalog to view the metadata. 

OutputArch.png

Data Attribution

The data used here originates from open data made available by the City of Vancouver, British Columbia. It contains information licensed under the Open Government License - Vancouver.

Was this article helpful?

We're sorry to hear that.

Please tell us why.

As of January 14th, 2026, comments on knowledge base articles have been closed. To make sure questions don’t get missed and to enable more community support, we’ve moved discussions to the FME Community. If you have a question or a comment about this article, please create a new post or create a support ticket.