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 are 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 previous metadata that was 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.).
BikePaths_L (ESRI Shapefile)
BikePaths_L (XML Document)
In the above images, we see a visualizations of the BikePaths_L shapefile and of a section of the BikePaths_L XML file.
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. When adding the XML reader, click on the parameters button and set the Configuration Type to "Feature Paths". In addition, click on the [...] button next to the Elements to Match dialog and in the resultant dialog window, check the box next to "metadata".
2. Define XML Feature as Metadata and Update
The AttributeCreator is used to create a metadata string attribute (geodb_metadata_string) that will hold the incoming XML definition contained in the xml_fragment attribute. In addition, the AttributeCreator will also be used to define the destination Geodatabase format as metadata. This is done via the use of a format parameter (geodb_type) set to the value geodb_metadata.
By looking at a section of the incoming metadata, one can see that a value indicating a minimum bike path length has not been applied to the metadata.
The XMLUpdater transformer will be used to update the incoming metadata with a new value. Within the XMLUpdater parameters dialog, in the XML Document section, set the following values:
In the Updates section of the transformer, set the following values:
Finally, set the Result Attribute to geodb_metadata_string.
Basically, this transformer this will take the metadata string, replace the path we chose with the new value, and write the new value back to the same attribute.
3. Join Line Features and Calculate Length
There are a couple of actions we will perform on the bike route linework. The LineJoiner transformer will connect line features together. When adding the LineJoiner, open the transformer's parameter dialog and click the [...] button for the Group-By parameter. Choose PathId, PathName, and PathType as the attributes to group by. The transformer will connect the line features together in instances where they share the same ID, Name, and Type.
The LengthCalculator will calculate the length of the incoming line features. When adding the LengthCalculator, open the transformer's parameter dialog and be sure to set the Length Attribute parameter to 'PathLength'.
4. Write Features and Metadata
Add the ESRI Geodatabase (File Geodb ArcObject) writer and specify the output Geodatabase to which the data will be written (i.e. VancouverCity). When prompted to select a feature type, be sure to select BikePaths_L [SHAPE]. Once added, connect the output of the XMLUpdater and LengthCalculator to the Geodatabase writer. As an optional step, double-click on the Geodatabase writer and, under General, rename the feature class/table name to "BikePaths". Save and run the workspace.
2 People are following this .