private void extractMetFromOutput(String output, Metadata met) {
        try (Scanner scanner = new Scanner(output)) {
            String currentKey = null;
            String[] headings = {"Subdatasets", "Corner Coordinates"};
            StringBuilder metVal = new StringBuilder();
            while (scanner.hasNextLine()) {
                String line = scanner.nextLine();
                if (line.contains("=") || hasHeadings(line, headings)) {
                    if (currentKey != null) {
                        // time to flush this key and met val
                        met.add(currentKey, metVal.toString());
                    }
                    metVal.setLength(0);

                    String[] lineToks = line.split("=");
                    currentKey = lineToks[0].trim();
                    if (lineToks.length == 2) {
                        metVal.append(lineToks[1]);
                    }
                } else {
                    metVal.append(line);
                }

            }
        }
    }
Wraps execution of the <a href="http//gdal.org/">Geospatial Data Abstraction
Library (GDAL)</a> <code>gdalinfo</code> tool used to extract geospatial
information out of hundreds of geo file formats.
<p/>
The parser requires the installation of GDAL and for <code>gdalinfo</code> to
be located on the path.
<p/>
Basic information (Size, Coordinate System, Bounding Box, Driver, and
resource info) are extracted as metadata, and the remaining metadata patterns
are extracted and added.
<p/>
The output of the command is available from the provided
{@link ContentHandler} in the
{@link #parse(InputStream, ContentHandler, Metadata, ParseContext)} method.
tika-parsers/tika-parsers-extended/tika-parser-scientific-module/src/main/java/org/apache/tika/parser/gdal/GDALParser.java