Package org.gdal.gdal

Class MajorObject

java.lang.Object
org.gdal.gdal.MajorObject
Direct Known Subclasses:
Band, Dataset, DataSource, Driver, Driver, Layer, Network

public class MajorObject extends Object
Class used for object with metadata.

The MajorObject class is a binding for the C++ GDALMajorObject class.

  • Method Details

    • delete

      public void delete()
    • SetMetadata

      public int SetMetadata(Hashtable metadata, String domain)
      Set metadata.

      The metadata is set into the domain specified.

      Parameters:
      metadata - the metadata as a table of (key, value) tuples to apply
      domain - the domain of interest. Use "" or null for the default domain.
      Returns:
      gdalconst.CE_None on success, gdalconst.CE_Failure on failure and gdalconst.CE_Warning if the metadata has been accepted, but is likely not maintained persistently by the underlying object between sessions.
    • SetMetadata

      public int SetMetadata(Hashtable metadata)
      Set metadata.

      The metadata is set into the default domain

      Returns:
      gdalconst.CE_None on success, gdalconst.CE_Failure on failure and gdalconst.CE_Warning if the metadata has been accepted, but is likely not maintained persistently by the underlying object between sessions.
      Since:
      Java bindings 1.7.0
    • GetDescription

      public String GetDescription()
      Fetch object description.

      The semantics of the returned description are specific to the derived type. For Dataset object it is the dataset name. For Band object it is actually a description (if supported) or "".

      Returns:
      description
    • SetDescription

      public void SetDescription(String newDescription)
      Set object description.

      The semantics of the returned description are specific to the derived type. For Dataset object it is the dataset name. For Band object it is actually a description (if supported) or "". Normally application code should not set the "description" for GDALDatasets. It is handled internally.

      Parameters:
      newDescription - new description
    • GetMetadataDomainList

      public Vector GetMetadataDomainList()
    • GetMetadata_Dict

      public Hashtable GetMetadata_Dict(String domain)
      Fetch metadata. Returns metadata as (key, value) tuples in the result table
      Parameters:
      domain - the domain of interest. Use "" or null for the default domain.
      Returns:
      null or a hash table with metadata
    • GetMetadata_Dict

      public Hashtable GetMetadata_Dict()
      Fetch metadata. Returns metadata from the default domain as (key, value) tuples in the result table
      Returns:
      null or a hash table with metadata
      Since:
      Java bindings 1.7.0
    • GetMetadata_List

      public Vector GetMetadata_List(String domain)
      Fetch metadata. Returns metadata as a vector of strings of the format "KEY=VALUE".
      Parameters:
      domain - the domain of interest. Use "" or null for the default domain.
      Returns:
      null or a vector of strings
    • GetMetadata_List

      public Vector GetMetadata_List()
      Fetch metadata.

      Returns metadata from the default domain as a vector of strings of the format "KEY=VALUE".

      Returns:
      null or a vector of strings
      Since:
      Java bindings 1.7.0
    • SetMetadata

      public int SetMetadata(Vector metadata, String domain)
      Set metadata.

      The metadata is set into the domain specified.

      Parameters:
      metadata - the metadata to apply as a vector of strings of the format "KEY=VALUE".
      domain - the domain of interest. Use "" or null for the default domain.
      Returns:
      gdalconst.CE_None on success, gdalconst.CE_Failure on failure and gdalconst.CE_Warning if the metadata has been accepted, but is likely not maintained persistently by the underlying object between sessions.
      Since:
      Java bindings 1.7.0
    • SetMetadata

      public int SetMetadata(Vector metadata)
      Set metadata.

      The metadata is set into the default domain

      Parameters:
      metadata - the metadata to apply as a vector of strings of the format "KEY=VALUE".
      Returns:
      gdalconst.CE_None on success, gdalconst.CE_Failure on failure and gdalconst.CE_Warning if the metadata has been accepted, but is likely not maintained persistently by the underlying object between sessions.
      Since:
      Java bindings 1.7.0
    • SetMetadata

      public int SetMetadata(String metadataString, String domain)
      Set metadata.

      The metadata is set into the domain specified.

      Parameters:
      metadataString - the metadata to apply as a string of the format "KEY=VALUE".
      domain - the domain of interest. Use "" or null for the default domain.
      Returns:
      gdalconst.CE_None on success, gdalconst.CE_Failure on failure and gdalconst.CE_Warning if the metadata has been accepted, but is likely not maintained persistently by the underlying object between sessions.
    • SetMetadata

      public int SetMetadata(String metadataString)
      Set metadata.

      The metadata is set into the default domain

      Parameters:
      metadataString - the metadata to apply as a string of the format "KEY=VALUE".
      Returns:
      gdalconst.CE_None on success, gdalconst.CE_Failure on failure and gdalconst.CE_Warning if the metadata has been accepted, but is likely not maintained persistently by the underlying object between sessions.
      Since:
      Java bindings 1.7.0
    • GetMetadataItem

      public String GetMetadataItem(String name, String domain)
      Fetch single metadata item.
      Parameters:
      name - the key for the metadata item to fetch.
      domain - the domain to fetch for, use null for the default domain.
      Returns:
      null on failure to find the key, or the value string on success.
    • GetMetadataItem

      public String GetMetadataItem(String name)
      Fetch single metadata item.

      The metadata item is searched into the default domain.

      Parameters:
      name - the key for the metadata item to fetch.
      Returns:
      null on failure to find the key, or the value string on success.
      Since:
      Java bindings 1.7.0
    • SetMetadataItem

      public int SetMetadataItem(String name, String value, String domain)
      Set single metadata item.
      Parameters:
      name - the key for the metadata item to fetch.
      value - the value to assign to the key.
      domain - the domain to set within, use null for the default domain.
      Returns:
      gdalconst.CE_None on success, or an error code on failure.
    • SetMetadataItem

      public int SetMetadataItem(String name, String value)
      Set single metadata item.

      The metadata item is set into the default domain.

      Parameters:
      name - the key for the metadata item to fetch.
      value - the value to assign to the key.
      Returns:
      gdalconst.CE_None on success, or an error code on failure.
      Since:
      Java bindings 1.7.0