data-cleaning.output-provider

convert-to-error-message

(convert-to-error-message error)
Returns a list of strings with validation error message and trace.
    error: Validation error.
 returns: A list of strings with error message and trace.

## Usage

    (require '[data-cleaning.output-provider :refer :all])

    (convert-to-error-message {:message "error message content"
                               :trace {"name1"
                                       {:rows 1 :columns [1 2 3]}
                                       "name2"
                                       2}})
    => '("Error: error message content"
         " file name1:\n\t{:rows 1, :columns [1 2 3]}"
         " file name2:\n\t2")

convert-to-warning-message

(convert-to-warning-message warning)
Returns a list of strings with validation warning message and trace.
    warning: Validation warning.
 returns: A list of strings with warning message and trace.

## Usage

    (require '[data-cleaning.output-provider :refer :all])

    (convert-to-warning-message {:message "warning message content"
                                 :trace {"name1"
                                         {:rows 1 :columns [1 2 3]}
                                         "name2"
                                         2}})
    => '("Warning: warning message content"
         " file name1:\n\t{:rows 1, :columns [1 2 3]}"
         " file name2:\n\t2")

map-to-raster-file

(map-to-raster-file map-vector map-properties)
Returns a collection of the raster file lines.
    map-vector: A vector of map cell values.
    map-properties: .asc preamble data.
 returns: Collection of the raster file lines.

## Usage

    (require '[data-cleaning.output-provider :refer :all])

    (map-to-raster-file [1 nil 2 nil 1 1.1 1 7 nil 1 "1.0" 1.0]
                        {:declared-size [3 4]
                         :cell-size 200.0
                         :left-bottom-corner [1.0 2.0]})
    => ["ncols 4"
        "nrows 3"
        "xllcorner 1.0"
        "yllcorner 2.0"
        "cellsize 200.0"
        "NODATA_value -9999"
        "1 -9999 2 -9999"
        "1 1.100000000000000 1 7"
        "-9999 1 1.0 1.000000000000000"]

stat-to-csv

(stat-to-csv statistics)
Returns a csv content with frequency
 for each Moore neighbourhood.
    statistics: A hash-map with Moore neighbourhood statistics.
 returns: A csv content.

## Usage

    (require '[data-cleaning.output-provider :refer :all])

    (stat-to-csv {[9 8 7 6 5 4 3 2 1] 2
                  [1 2 3 4 5 6 7 8 9] 3
                  [1 1 1 1 1 1 1 1 1] 1
                  [0 0 0 0 0 0 0 0 0] 2})
    => '(["No."
          "Left-upper" "Center-upper" "Right-upper"
          "Left-middle" "Center-middle" "Right-middle"
          "Left-lower" "Center-lower" "Right-lower"
          "Rank" "Frequency"]
         ["1" "1" "2" "3" "4" "5" "6" "7" "8" "9" "1" "3"]
         ["2" "9" "8" "7" "6" "5" "4" "3" "2" "1" "2-3" "2"]
         ["3" "0" "0" "0" "0" "0" "0" "0" "0" "0" "2-3" "2"]
         ["4" "1" "1" "1" "1" "1" "1" "1" "1" "1" "4" "1"])

stat-to-latex-tabular

(stat-to-latex-tabular statistics)
Returns a latex tabular content with frequency
 for each Moore neighbourhood.
    statistics: A hash-map with Moore neighbourhood statistics.
 returns: A content of latex tabular section.

## Usage

    (require '[data-cleaning.output-provider :refer :all])

    (stat-to-latex-tabular {[1 1 0 0 1 0 0 0 1] 3})
    => ["1"
        " & \begin{minipage}{7mm}\baselineskip=0pt"
        "\textcolor{black}{\rule{2mm}{2mm}}\hspace{0.3mm}\textcolor{black}{\rule{2mm}{2mm}}\hspace{0.3mm}\textcolor{lightgray}{\rule{2mm}{2mm}}\hspace{0.3mm} \\"
        "\textcolor{lightgray}{\rule{2mm}{2mm}}\hspace{0.3mm}\textcolor{black}{\rule{2mm}{2mm}}\hspace{0.3mm}\textcolor{lightgray}{\rule{2mm}{2mm}}\hspace{0.3mm} \\"
        "\textcolor{lightgray}{\rule{2mm}{2mm}}\hspace{0.3mm}\textcolor{lightgray}{\rule{2mm}{2mm}}\hspace{0.3mm}\textcolor{black}{\rule{2mm}{2mm}}\hspace{0.3mm} \\"
        "\end{minipage} "]