Exports¶
This page tells you how to get data and reports out of LUC Analytics (LUCA), and when each export is not available.
In this page, a control or a label of the app is in bold. A message of the app is in "double quotes".
Summary of exports¶
| Export | Where the control is | Format | File name |
|---|---|---|---|
| List results, post-2020 | The ⋯ menu of the list on the lists page, item Export | CSV | <list name> - post2020.csv |
| List results, post-2020 | The POST-2020 RISK ASSESSMENT tab of a list, button ⬇ Download CSV | CSV | <list name> - post2020.csv |
| List results, alerts | The RECENT DISTURBANCE ALERTS tab of a list, button ⬇ Download CSV | CSV | <list name> - alerts.csv |
| List results, emission factors | The ⋯ menu of the list on the lists page, item Download emissions factors (CSV) | CSV | <list name> - ef.csv |
| List results, emission factors | The EMISSIONS FACTOR tab of a list, button ⬇ Download CSV | CSV | <list name> - ef-<year>.csv |
| One location | The Location Details panel, button ⬇ Download CSV | CSV | <list name> - location <id> detail.csv |
| One location report | The Location Details panel, button Download PDF | location-<id>-report.pdf, location-<id>-post2020-alerts-report.pdf or location-<id>-ef-report.pdf |
|
| Data used | Comes with each CSV export, as a second file | CSV | <CSV name>.data-used.csv |
| Map configuration | A map, Configuration panel, button Download a copy | .mpky (JSON) |
The name of the configuration, for example mapkey_0001.mpky |
If the list name gives no usable file name, the app uses the list ID, for example list-<list id>-post2020.csv or location-<id>-detail.csv. The app replaces characters that Windows, macOS or Linux do not permit in a file name.
When an export is available¶
The browser and the server each do a check before an export. The two checks use the same rule:
-
An export of a full list is available only when the analysis of the list is complete.
-
An export of one location is available only when the analysis of that location is finished.
| Export | Necessary condition |
|---|---|
| List CSV and its data-used file (Export and the two ⬇ Download CSV buttons) | The status of the list is complete. Before that, the tooltip shows "CSV export becomes available once the analysis of this list is complete." |
| Location CSV and its data-used file | Each analysis of the list is finished for that location. |
| Emission factors CSV and its data-used file (menu item Download emissions factors (CSV) and the button of the EMISSIONS FACTOR tab) | The status of the list is complete, and no location of the list is still processing its emission factors. Before that, the button is not available and the tooltip shows the same text. |
| Location PDF | The post-2020 analysis of that location is finished. The map must also be ready to capture. If the list has emission factors, the emissions analysis of that location must also be finished for a report that contains emission factors. Before that, the menu items One report - all analyses and EF report are not available. In the drawer from the EMISSIONS FACTOR tab, you can also get the EF report when only the emissions analysis is finished. |
These are the results of the checks:
-
You cannot export the CSV of a list that is not complete. A list with the label Incomplete (for example, after Halt & commit) stays in this condition. For such a list, export each finished location.
-
You can download the CSV or the PDF of a finished location. The other locations of the list do not have to be finished.
-
The PDF of a location in a list that is not complete has a note, for example "Report generated from a partially-analyzed list — 40/50 locations analyzed (80%)". If the app cannot count the locations, the note is "Report generated from a partially-analyzed list — number of locations analyzed could not be confirmed".
-
The app does not write a zero in place of a value that it did not calculate. There is no override for these checks.
If the server refuses an export, the app shows one of these messages:
-
"Export unavailable — no locations have been analyzed for this list yet, so there is nothing to export."
-
"CSV export becomes available once the analysis of this list is complete."
-
"Export unavailable — this location’s analysis has not finished. Export becomes available once every analysis for it is complete."
-
"PDF export unavailable — no locations have been analyzed for this list yet."
For more information about analysis states, see 03-analysis-and-results.md.
Export the results of a list as CSV¶
You can start the post-2020 export from the lists page or from the list. The two controls give the same file.
From the lists page:
- Go to the lists page (Lists).
- On the row of the list, push ⋯.
- Select Export.
From the list:
- Open the list.
- Select the POST-2020 RISK ASSESSMENT tab or the RECENT DISTURBANCE ALERTS tab.
- If you use the alerts tab, set the alert dates on the Alerts date chip. The CSV uses the same dates.
- Push ⬇ Download CSV.
The browser downloads two files: the CSV and its data-used file. For the data-used file, see "The data-used file" below.
Contents of the post-2020 CSV¶
The CSV has one row for each location. The columns are:
-
The identity of the location:
location_id,location_name,load_order,status,centroid_lat,centroid_lon. -
The analysis date and dataset version:
post2020_analysis_date,post2020_dataset_version. -
The areas in hectares:
total_area_ha,sbtn_area_ha,jrc_area_ha, and the flagssbtn_flagandjrc_flag. -
The loss after 2020 for each forest basemap:
sbtn_loss_ha_post2020,jrc_loss_ha_post2020. There is also one column for each loss year, for examplesbtn_loss_ha_2021. -
The drivers of tree cover loss: one
driver_<name>_hacolumn for each driver. Thendominant_driver,dominant_share,dominant_is_mixedanddominant_is_none. -
The errors:
error_code,error_numberandexplanation. The number inerror_numberis the standard number of the error, and the explanation starts with that number, in the language of the export. For the meaning of each number and the action that corrects it, see 07-troubleshooting.md, section "Error codes". -
The state:
finished_state,list_status,list_locations_computed,list_locations_total.
Contents of the emission factors CSV¶
The emission factors CSV has one row for each location, for one reporting year. The menu item gives the latest year. The button of the EMISSIONS FACTOR tab gives the year that you selected in Reporting year. The file has the same identity, error and state columns as the post-2020 CSV. It also has these columns:
-
The analysis date and dataset version:
ef_analysis_date,ef_dataset_version. -
The area in hectares:
total_area_ha. -
The year and the crop:
reporting_year,commodity,commodity_code. -
The yield and the production:
yield_kg_ha,production_Mg. -
The factors:
ef_total_MgCO2e_per_Mg_production,ef_co2_MgCO2e_per_Mg_production,ef_ch4_MgCO2e_per_Mg_productionandef_n2o_MgCO2e_per_Mg_production.
A location with no yield has empty cells for the production and the factors. Its explanation column says, for example: "No yield for 2025: add one to calculate the emissions factor." The file has no row for the total of the list. Each factor is for one location.
Contents of the alerts CSV¶
The alerts CSV has one row for each location. It has the same identity, area, error and state columns as the post-2020 CSV. It also has these columns: alerts_analysis_date, alerts_dataset_version, alert_area_ha, alert_sbtn_area_ha, alert_jrc_area_ha, window_start and window_end. The two window columns show the dates of the alerts that the file counts.
Export one location as CSV¶
- Open the list.
- On the row of the location, push DETAILS. The Location Details panel opens.
- Push ⬇ Download CSV.
The CSV has one row. It contains the identity, area, loss and driver columns of the post-2020 CSV, and the alerts columns of the alerts CSV. It also contains the annotation column, which is your note about the location. If the list has emission factors, the CSV also has the column ef_total_area_ha. For each reporting year it has the columns yield_kg_ha_<year>, production_Mg_<year>, ef_total_MgCO2e_per_Mg_production_<year> and the three columns of the gases for that year. The browser also downloads the data-used file for that location.
Download a PDF report of one location¶
- Open the list.
- On the row of the location, push DETAILS.
- Wait until the map in the Location Details panel is fully drawn.
- Push Download PDF.
- If the list has emission factors, a menu opens. Push one of these items:
- One report - all analyses: one PDF with all the analyses of the location (
location-<id>-report.pdf). - Post-2020 & Alerts report: only the post-2020 and alerts parts (
location-<id>-post2020-alerts-report.pdf). - EF report: only the emission factors (
location-<id>-ef-report.pdf).
If the emissions analysis of the location is not finished, One report - all analyses and EF report are not available. If you open the drawer from the EMISSIONS FACTOR tab and only the emissions analysis is finished, Download PDF makes the EF report.
While the app makes the PDF, the map shows "Preparing the report...". Before the app makes the PDF, it waits for the basemap tiles and the analysis layers. If they are not ready, the app does not make the file. It shows a message that tells you the cause. For example: "PDF export unavailable — still waiting for: basemap tiles loading (6 of 9 loaded). Please wait and try again." If the emissions analysis is not finished, the message is "Emissions factors is still processing for this location."
The PDF is in landscape. The report of all analyses contains these items:
- A title: the name and the ID of the location.
- A note, only if the list is not complete. The note gives the number of finished locations. Refer to "When an export is available" above.
- Two map images: "Boundary on basemap" and "Boundary + active analysis layers on basemap".
- "Layer settings used for these images". This part gives the color and opacity of each layer, the loss years, the alert dates and the map resolution.
- The details of the location: the name, the area and your notes.
- The table of forest loss for each year, for the SBTN basemap and the JRC basemap.
- The alerts, if the list has the alerts analysis.
- The drivers of tree cover loss, as a pie chart with a legend. If there are no driver data, the PDF says so.
- The emission factors, only if the list has emission factors. Before this page, a page shows two map images of the EF map group, with the layer EF look-back pixel window and its legend. The heading is "Emissions factors (direct land-use change)". The unit line shows "t CO2e / t". A table shows one row for each reporting year, with the columns Reporting year, Total (sum of gases), CO2, CH4 and N2O. A line gives the name, the commodity, the area, the yield and the production of the latest year. A note tells you the method. A year with no yield shows "Yield needed" in place of numbers.
- "Data used": the datasets and their versions. If the report has emission factors, a second "Data used" part gives the datasets of the emissions analysis.
- "How to cite the data": the attribution text.
The Post-2020 & Alerts report contains items 1 to 8, 10 and 11, without the emission factors.
The EF report contains these items:
- A title: the name and the ID of the location, and the note if the list is not complete.
- Two map images of the EF map group and the legend of the layer EF look-back pixel window.
- The emission factors, as in item 9 above.
- "Data used": only the datasets of the emissions analysis.
- "How to cite the data": the attribution text.
The EF report does not have the details of the location, the forest loss, the alerts and the drivers.
NOTE: The map images can be larger than on the screen. Then the PDF tells you the scale, for example "Map panels scaled ×2.00 from on-screen resolution for this report."
For the map controls that change the images, see 04-maps.md.
The data-used file¶
Each CSV export comes with a second file. Its name is the CSV name with .data-used.csv in place of .csv. It contains one row for each source dataset, with these columns: dataset, version_id, date, date_kind, local_or_s3, profile, currency_at_run, hash, location.
The data-used file is written the same way as the CSV it comes with: UTF-8 with a byte order mark, the lines end with CR LF, and the separator is the one the CSV uses (; in the semicolon form). Read it with encoding="utf-8-sig" (or utf-8-sig in pandas) so the mark is not part of the first column name.
If the analysis ran before the app recorded the vintage (the dataset dates and the profile), the file still has one row for each source dataset, with the version, date, kind of date, local or S3, hash and location that the run recorded. Where the run recorded no date, the row says date not recorded; the profile column says none.
The data-used file of the emission factors CSV names only the datasets that the emissions analysis reads: pixel_area, filtered_tcl_year, emis_co2, emis_ch4 and emis_n2o. It does not name SBTN Natural Forest and JRC Global Forest Cover 2020.
The file has one row with the text vintage not recorded only when the run recorded no dataset at all (for example the demo list).
The CSV can download when the data-used file does not. Then the app shows "The CSV downloaded, but its Data-used sidecar file (the source dataset dates) could not be downloaded." Push the button again to get the two files.
Format of the CSV files¶
-
The text is UTF-8 with a byte order mark. The lines end with CR LF.
-
The first line is a machine-readable header (refer to "Reading this file in code" below). After it come the attribution lines. The header row of the table comes after them.
-
The attribution lines are comment lines: each one starts with
#. Each line is written as ONE quoted cell, in both forms of the table and for every line, even a line that holds no separator. Thus a spreadsheet keeps each line in column A, and a program that reads the file with either separator still gets one field per comment line. A citation holds commas (the author lists), and without the quotes a spreadsheet would split it into many cells above the table. The citation text itself is unchanged. The hierarchy is shown with indentation: a dataset is a heading line with its name and license, and its citations follow with two spaces in front (a component's name and its citation share the line, for example# GLAD-L: Hansen, M.C., ...). -
Numbers have no thousands separator. Areas have a maximum of 4 decimal places.
-
A cell is empty when the app has no value for it, for example a location with an error. The app does not write a zero in place of a value that it did not calculate.
NOTE: If a text cell starts with =, +, -, @ or a tab, the app puts ' before the text. Thus, a spreadsheet program does not read the text as a formula.
Comma or semicolon¶
A spreadsheet in a region that writes a decimal comma (for example pt-BR, es-CO or fr) expects ; between the values and , in the numbers. The app writes two forms of the same table:
| Form | Separator | Decimal mark | Example |
|---|---|---|---|
| Comma (the default) | , |
. |
3043.26 |
| Semicolon | ; |
, |
3043,26 |
In Settings, in CSV for spreadsheets, choose Automatic, Comma + decimal point or Semicolon + decimal comma. Automatic follows the locale of your browser, not the language of the app: a browser set to a decimal-comma region gets the semicolon form, and a browser set to Mexico (a decimal point) keeps the comma form.
The machine header of each file states which form the file uses, so a program does not have to know. The command luc-analytics export --csv-format semicolon writes the semicolon form, and the API accepts ?csv_format=semicolon on the three export routes.
The dataset version columns¶
The columns post2020_dataset_version, alerts_dataset_version and ef_dataset_version hold a short stamp, for example:
recorded=2026-10-20T05:36:26Z | data-used: tcl_year=v5 | jrc_area=v4
Each <dataset>=<version_id> pair names exactly one row of the data-used file that comes with the export (refer to "The data-used file" above): match the pair against the columns dataset and version_id of that file. The full statement — the date, the kind of date, local or S3, the profile, the currency at the time of the run, the hash and the location — is only in the data-used file, so the same text is not repeated in every row of the table. The stamp in ef_dataset_version names only the datasets of the emissions analysis.
A run that the app recorded before the vintage was kept writes the same stamp, with nothing after recorded=:
recorded= | data-used: tcl_year=v5 | jrc_area=v4
The version, date, kind of date, local or S3, hash and location of that run are in the rows of the data-used file, as described above.
Reading this file in code¶
Do not tell your program to skip lines that start with #. The quote comes first in those lines, so a reader that looks for a leading # (for example pandas.read_csv(..., comment="#")) does not skip them and reads the citations as rows of data.
Read the first line instead. It is a comment line written as one quoted cell, and it gives the number of lines to skip and the separator and decimal mark of the file:
# luc-analytics-csv | format=1 | preamble=12 | delimiter=',' | decimal='.' | lang=en
preamble counts the leading lines to skip, this header line included. So the column header is the first line after the skipped lines. Its value depends on the analysis: more datasets (and more alert components) add lines.
The values are separated by |, and delimiter and decimal are quoted because the values themselves are punctuation. A file exported by an earlier release has the same keys separated by spaces and no quotes; the snippets below read the new form (the app's own reader, csv_format.read_export, reads both).
With the csv module of Python:
import csv
with open(path, encoding="utf-8-sig", newline="") as f:
first_line = f.readline()
fields = {
key: value.strip("'")
for key, value in (token.split("=", 1) for token in first_line.strip().strip('"').split(" | ")[1:])
}
for _ in range(int(fields["preamble"]) - 1):
f.readline()
rows = list(csv.reader(f, delimiter=fields["delimiter"]))
With pandas:
import pandas as pd
with open(path, encoding="utf-8-sig", newline="") as f:
first_line = f.readline()
fields = {
key: value.strip("'")
for key, value in (token.split("=", 1) for token in first_line.strip().strip('"').split(" | ")[1:])
}
df = pd.read_csv(
path,
encoding="utf-8-sig",
sep=fields["delimiter"],
decimal=fields["decimal"],
skiprows=int(fields["preamble"]),
)
In both snippets, path is the path of the CSV file. fields["delimiter"] and fields["decimal"] are the two values that the file declares, so the same code reads the comma form and the semicolon form.
Attribution and licenses¶
The "Special Terms of Use for GNW Self-Hosted Monitoring" of WRI apply to the data. You must attribute the data when you share an output. You must not suggest that WRI endorses, sponsors, certifies or approves you or your use of the data.
The app adds the attribution text to each CSV export and to each PDF report. The text has these parts:
- The GNW citation, with the access date: "Global Nature Watch. [year]. World Resources Institute. Accessed on [date]." The access date is the date when the last run of the list finished.
- The citation of each dataset that the export uses, with its license.
- "Computed with LUC Analytics, an independent project, using methods adapted from WRI's published scripts (post2020.py, GNW Self-Hosted Monitoring). WRI does not endorse this project or its results."
- "Use of these data is subject to WRI's Special Terms of Use for GNW Self-Hosted Monitoring: https://www.wri.org/about/legal/gnw-shm-tos"
The datasets in each export are:
| Export | Datasets |
|---|---|
| Post-2020 CSV | Tree cover loss, SBTN Natural Forest, JRC Global Forest Cover 2020, Dominant Drivers of Forest Loss |
| Alerts CSV | Global Integrated Disturbance Alerts, SBTN Natural Forest, JRC Global Forest Cover 2020 |
| Emission factors CSV | Tree cover loss, Gross emissions (forest carbon flux model) |
| Location CSV and location PDF | All five datasets above. For a list that has emission factors, also Gross emissions (forest carbon flux model). |
| EF report (PDF) | Tree cover loss, Gross emissions (forest carbon flux model) |
The licenses are:
| License | Datasets |
|---|---|
| CC BY 4.0 | Tree cover loss, SBTN Natural Forest, Dominant Drivers of Forest Loss, Global Integrated Disturbance Alerts, Gross emissions (forest carbon flux model) |
| Free of charge, without restriction of use (Copernicus Regulation of the European Commission) | JRC Global Forest Cover 2020 |
For a list with synthetic demo data, the attribution text is different. It says "Synthetic demo data generated by LUC Analytics. No WRI dataset was read for these figures."
To read the attribution text in the app, push Data sources and licenses at the bottom of the page. The full text is in the file DATA-ATTRIBUTION.md in the project repository.
CAUTION: Keep the attribution lines when you copy data from a CSV into a different file. If you remove them, the new file does not tell readers the source and the license of the data.
Download a map configuration¶
A map configuration keeps the settings of your maps in a file, so that you can use them again. It is not a results export.
- On a map, push Configuration.
- In Saved configurations, select the configuration.
- Push Download a copy.
The file is a JSON document with the extension .mpky. To add the file to a different installation, push Add from this computer… on a map of that installation. For more information, see 04-maps.md.
Command line export¶
The program also has the command luc-analytics export for administrators. It writes the CSV of a list (--analysis post2020 or --analysis alerts) or of one location (--analysis detail --location-id <id>). The arguments --start and --end set the alert dates. The argument --output sets the file. Without --output, the command writes to the standard output.
The command uses the same checks as the app. For a whole list, the list must be complete. For a single location, that location must be finished. If the check fails, the command writes no file. It shows a message that starts with export_refused: and stops with exit code 1. The command does not write the data-used file.