Class SpreadSheetToKML

  • All Implemented Interfaces:
    adams.core.AdditionalInformationHandler, adams.core.CleanUpHandler, adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.QuickInfoSupporter, adams.core.ShallowCopySupporter<adams.data.conversion.AbstractConversion>, adams.core.SizeOfHandler, adams.core.Stoppable, adams.data.conversion.Conversion, Serializable

    public class SpreadSheetToKML
    extends adams.data.conversion.AbstractConversion
    Turns a spreadsheet into a KML (Keyhole Markup Language) XML data structure.
    For more information see:
    http://en.wikipedia.org/wiki/Keyhole_Markup_Language

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -column-gps <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: columnGPS)
        The column with the GPS coordinate objects.
        default: first
        example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last
     
    -column-elevation <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: columnElevation)
        The column with the (optional) elevation for the PlaceMark nodes; uses 0 
        if empty.
        default: 
        example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last
     
    -column-id <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: columnID)
        The column with the (optional) ID for the PlaceMark nodes; uses 1-based 
        row index if empty.
        default: 
        example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last
     
    -column-name <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: columnName)
        The column with the (optional) name for the PlaceMark nodes; uses 1-based 
        row index if empty.
        default: 
        example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected adams.data.spreadsheet.SpreadSheetColumnIndex m_ColumnElevation
      the column with the (optional) elevation.
      protected adams.data.spreadsheet.SpreadSheetColumnIndex m_ColumnGPS
      the column with the GPS objects.
      protected adams.data.spreadsheet.SpreadSheetColumnIndex m_ColumnID
      the column with the (optional) ID of the PlaceMark.
      protected adams.data.spreadsheet.SpreadSheetColumnIndex m_ColumnName
      the column with the (optional) name of the PlaceMark.
      • Fields inherited from class adams.data.conversion.AbstractConversion

        m_Input, m_Output, m_Owner, m_Stopped
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Class accepts()
      Returns the class that is accepted as input.
      String columnElevationTipText()
      Returns the tip text for this property.
      String columnGPSTipText()
      Returns the tip text for this property.
      String columnIDTipText()
      Returns the tip text for this property.
      String columnNameTipText()
      Returns the tip text for this property.
      void defineOptions()
      Adds options to the internal list of options.
      protected Object doConvert()
      Performs the actual conversion.
      Class generates()
      Returns the class that is generated as output.
      adams.data.spreadsheet.SpreadSheetColumnIndex getColumnElevation()
      Returns the (optional) column with the elevations.
      adams.data.spreadsheet.SpreadSheetColumnIndex getColumnGPS()
      Returns the column with the GPS coordinate objects.
      adams.data.spreadsheet.SpreadSheetColumnIndex getColumnID()
      Returns the (optional) column with the PlaceMark IDs.
      adams.data.spreadsheet.SpreadSheetColumnIndex getColumnName()
      Returns the (optional) column with the PlaceMark names.
      String getQuickInfo()
      Returns a quick info about the object, which can be displayed in the GUI.
      String globalInfo()
      Returns a string describing the object.
      void setColumnElevation​(adams.data.spreadsheet.SpreadSheetColumnIndex value)
      Sets the (optional) column with the elevations.
      void setColumnGPS​(adams.data.spreadsheet.SpreadSheetColumnIndex value)
      Sets the column with the GPS coordinate objects.
      void setColumnID​(adams.data.spreadsheet.SpreadSheetColumnIndex value)
      Sets the (optional) column with the PlaceMark IDs.
      void setColumnName​(adams.data.spreadsheet.SpreadSheetColumnIndex value)
      Sets the (optional) column with the PlaceMark names.
      • Methods inherited from class adams.data.conversion.AbstractConversion

        checkData, cleanUp, convert, getAdditionalInformation, getInput, getInput, getOutput, getOutput, getOwner, reset, setInput, setOwner, shallowCopy, shallowCopy, stopExecution
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Field Detail

      • m_ColumnGPS

        protected adams.data.spreadsheet.SpreadSheetColumnIndex m_ColumnGPS
        the column with the GPS objects.
      • m_ColumnElevation

        protected adams.data.spreadsheet.SpreadSheetColumnIndex m_ColumnElevation
        the column with the (optional) elevation.
      • m_ColumnID

        protected adams.data.spreadsheet.SpreadSheetColumnIndex m_ColumnID
        the column with the (optional) ID of the PlaceMark.
      • m_ColumnName

        protected adams.data.spreadsheet.SpreadSheetColumnIndex m_ColumnName
        the column with the (optional) name of the PlaceMark.
    • Constructor Detail

      • SpreadSheetToKML

        public SpreadSheetToKML()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • setColumnGPS

        public void setColumnGPS​(adams.data.spreadsheet.SpreadSheetColumnIndex value)
        Sets the column with the GPS coordinate objects.
        Parameters:
        value - the column
      • getColumnGPS

        public adams.data.spreadsheet.SpreadSheetColumnIndex getColumnGPS()
        Returns the column with the GPS coordinate objects.
        Returns:
        the column
      • columnGPSTipText

        public String columnGPSTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setColumnElevation

        public void setColumnElevation​(adams.data.spreadsheet.SpreadSheetColumnIndex value)
        Sets the (optional) column with the elevations.
        Parameters:
        value - the column
      • getColumnElevation

        public adams.data.spreadsheet.SpreadSheetColumnIndex getColumnElevation()
        Returns the (optional) column with the elevations.
        Returns:
        the column
      • columnElevationTipText

        public String columnElevationTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setColumnID

        public void setColumnID​(adams.data.spreadsheet.SpreadSheetColumnIndex value)
        Sets the (optional) column with the PlaceMark IDs.
        Parameters:
        value - the column
      • getColumnID

        public adams.data.spreadsheet.SpreadSheetColumnIndex getColumnID()
        Returns the (optional) column with the PlaceMark IDs.
        Returns:
        the column
      • columnIDTipText

        public String columnIDTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setColumnName

        public void setColumnName​(adams.data.spreadsheet.SpreadSheetColumnIndex value)
        Sets the (optional) column with the PlaceMark names.
        Parameters:
        value - the column
      • getColumnName

        public adams.data.spreadsheet.SpreadSheetColumnIndex getColumnName()
        Returns the (optional) column with the PlaceMark names.
        Returns:
        the column
      • columnNameTipText

        public String columnNameTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getQuickInfo

        public String getQuickInfo()
        Returns a quick info about the object, which can be displayed in the GUI.
        Specified by:
        getQuickInfo in interface adams.core.QuickInfoSupporter
        Overrides:
        getQuickInfo in class adams.data.conversion.AbstractConversion
        Returns:
        null if no info available, otherwise short string
      • accepts

        public Class accepts()
        Returns the class that is accepted as input.
        Specified by:
        accepts in interface adams.data.conversion.Conversion
        Specified by:
        accepts in class adams.data.conversion.AbstractConversion
        Returns:
        the class
      • generates

        public Class generates()
        Returns the class that is generated as output.
        Specified by:
        generates in interface adams.data.conversion.Conversion
        Specified by:
        generates in class adams.data.conversion.AbstractConversion
        Returns:
        the class
      • doConvert

        protected Object doConvert()
                            throws Exception
        Performs the actual conversion.
        Specified by:
        doConvert in class adams.data.conversion.AbstractConversion
        Returns:
        the converted data
        Throws:
        Exception - if something goes wrong with the conversion