Skip to content
theranjali-nilaweera edited this page Jun 17, 2015 · 26 revisions

FarmBuild Soil Sample Importer Wiki

The soil sample importer enables you to load a FarmData JOSN and import soil sample results in to it.

Inputs

  • FarmData JSON. Refer to farmbuild-farmdata component wiki for more details of the contents of the JSON.
  • CSV file containing the soil sample results of the farm in teh FarmData JSON. The CSV file should contain the headers of each column as the first row.

Output

  • FarmData JSON with the the soil sample results information included.

Customizable reference JSON structures

There are two JSON files required to carry out the sample result importing. These files are fully customizable.

*Import Field Defaults

This file defines the fields which the user has to match the CSV columns to. The mandatory keys currently in the file are described below
* name : The name user would see in the drop down for the column selection in the example. * soilClassificationName: name of the object defined in soil classification defaults file. If no classification leave as undefined. * hasAverage: If it is possible to average the field values or not.

The default file been used in these examples can be found at /src/import-field-definition/defaults.conf.src.js .

*Soil Classification Defaults

This file describes the range classifications for the import fields defined in the above mentioned import field defaults file. All the import fields need not have a range classification. A range classification of a single field currently has the following keys.
* name : The name used to map the soilClassificationName in the import fields defaults file. * ranges : * name: Name visible to the user when the classification is done. * min : Min value of the range * max : Max value of the range. * defaultColor : The color code for each range.

Complex range classifications, ranges based on other range values, has not yet been implemented in the current farmbuil-soil-sample-importer component. The default file been used in these examples can be found at /src/soil-classification/defaults.conf.src.js.

Clone this wiki locally