I have an output CSV from Collect Earth and their survey used to record historical data for the LULUCF. Currently, I need to review and update the records as necessary, but I don't have the respective XML file. So, I would like to know if is there a way to import these data to Collect Earth using CSV file? asked 18 May '23, 14:41 Hercilo |
The Export/Import in Collect Earth is always easiest if you have the XML format. PLEASE ALWAYS KEEP A COPY OF THE DATA COLLECTED AS AN XML!!! ATTENTION : if you just want to update data you already have in Collect Earth though a CSV follow these instructions Importing CSVs to an empty database gets a bit complicated as it must be done through Collect https://openforis.org/tools/collect/ (not Collect Earth ) The steps to reproduce are as follow (see images at the bottom :
Caveats :The CSV data import is done at entity level. Meaning that you have one CSV per entity in the CE survey. Most surveys have a parent entity called plot which all the data in the db is descending from. You must import the data from that level first. Then you need to import the sub-entities, which in most CE surveys refer to Land Cover. If you want to know what is the structure that you should use in the CSVs that you use for importing you can check in the Survey editor section on the Collect tool. Go to your survey, then on the advanced features (bottom-right) click on "Export CSV data import/export template". This will generate a ZIP file with the structure of the CSV files for the root entity, plot and if there are, its subentities. EXAMPLE WITH SURVEY WITH PLOT ENTITY WITH LAND COVER AND LAND USE SUB-ENTITIESI have created a survey using the CE IPCC template to collect land use and land cover. I have published the survey. This survey has three entities, the root one called plot and then its subentities "land_use" and "land_cover" So, with my test CEP called import_test ( CEP file ) I have collected data for 2 plots ( this is the XML file with the plots ) . As I want to show how to import the data from a CSV instead of an XML (the easy way), I have exported the data to CSV generating this file with all the data for the 2 plots. Then, following the template for the CSV data import/export that I generated as explained before (this is the info that I got ) I have split the original CSV into three files, the plot.csv file, the land_use.csv file and the land_cover.csv file . Notice how for each plot in the plot_csv file I have six lines in the land_use and 9 lines in the land_cover file! This is because the database will generate one record per land use or land cover! I have then gone to the Data Management section in Collect and selected the import_test survey to start operating with: Then on the import CSV option we start by importing the CSV of plots ( the root entity). Choose the option to "Insert new records" and upload the plots.csv file: After you import the plots, then you need to use the option to "Update existing records", then choose land_use and after land_cover. After you have done this (and hopefully it all worked) you will have all the data in you Collect database. You can then export the data to XML and import it back into Collect Earth!! EASY PEASY!! LESSON LEARNT : Always keep the data from you Collect Earth assessments on the XML (zipped) format! Data management will be so much easier!!!!:)
answered 22 May '23, 12:56 Open Foris ♦♦ |