Class GDALParser

  • All Implemented Interfaces:
    Serializable, org.apache.tika.parser.Parser

    public class GDALParser
    extends Object
    implements org.apache.tika.parser.Parser
    Wraps execution of the Geospatial Data Abstraction Library (GDAL) gdalinfo tool used to extract geospatial information out of hundreds of geo file formats.

    The parser requires the installation of GDAL and for gdalinfo to be located on the path.

    Basic information (Size, Coordinate System, Bounding Box, Driver, and resource info) are extracted as metadata, and the remaining metadata patterns are extracted and added.

    The output of the command is available from the provided ContentHandler in the parse(InputStream, ContentHandler, Metadata, ParseContext) method.

    See Also:
    Serialized Form
    • Constructor Detail

      • GDALParser

        public GDALParser()
    • Method Detail

      • getCommand

        public String getCommand()
      • setCommand

        public void setCommand​(String command)
      • getSupportedTypes

        public Set<org.apache.tika.mime.MediaType> getSupportedTypes​(org.apache.tika.parser.ParseContext context)
        Specified by:
        getSupportedTypes in interface org.apache.tika.parser.Parser
      • parse

        public void parse​(InputStream stream,
                          ContentHandler handler,
                          org.apache.tika.metadata.Metadata metadata,
                          org.apache.tika.parser.ParseContext context)
                   throws IOException,
                          SAXException,
                          org.apache.tika.exception.TikaException
        Specified by:
        parse in interface org.apache.tika.parser.Parser
        Throws:
        IOException
        SAXException
        org.apache.tika.exception.TikaException
      • setTimeoutMs

        @Field
        public void setTimeoutMs​(long timeoutMs)
      • setMaxStdErr

        @Field
        public void setMaxStdErr​(int maxStdErr)
      • setMaxStdOut

        @Field
        public void setMaxStdOut​(int maxStdOut)