Note
Click here to download the full example code
Converting CSV to GSpy Raster formats without metadata
Traceback (most recent call last):
File "/Users/nfoks/codes/repositories/gspy/gspy_secondary/documentation_source/source/examples/The_GS_Standard/plot_help_I_have_no_variable_metadata.py", line 23, in <module>
survey.add_tabular(type='csv', data_filename=d_data, metadata_file=d_supp)
File "/Users/nfoks/codes/repositories/gspy/gspy_secondary/gspy/src/classes/survey/Survey.py", line 131, in add_tabular
out = tabular_csv.Tabular_csv.read(data_filename, metadata_file=metadata_file, spatial_ref=self.spatial_ref, **kwargs)
File "/Users/nfoks/codes/repositories/gspy/gspy_secondary/gspy/src/classes/data/Tabular.py", line 135, in read
cls._create_variable_metadata_template(filename, file.df.columns)
File "/Users/nfoks/codes/repositories/gspy/gspy_secondary/gspy/src/classes/data/tabular_csv.py", line 183, in _create_variable_metadata_template
raise Exception(s)
Exception:
Variable metadata values are not defined in the ..//supplemental information file.
Creating a template with filename variable_metadata_template_Resolve.json
Please fill out and add the dictionary to the ..//supplemental information file.
import matplotlib.pyplot as plt
from os.path import join
from gspy import Survey
# Path to example files
data_path = '..//..//supplemental'
# Define ..//supplemental information file
..//supplemental = join(data_path, "region//MAP//data//Resolve_survey_md.json")
survey = Survey(..//supplemental)
d_data = join(data_path, 'region//MAP//data//Resolve.csv')
d_supp = join(data_path, 'region//MAP//data//Resolve_data_md_without_variables.json')
survey.add_tabular(type='csv', data_filename=d_data, metadata_file=d_supp)
Total running time of the script: ( 0 minutes 1.657 seconds)