{"id":308138,"name":"Africa Soil and Agronomy Data Cube","description":"Accessing and using soil and agronomy data for Africa.","url":"https://gitlab.com/openlandmap/africa-soil-and-agronomy-data-cube","last_synced_at":"2026-04-14T14:00:32.222Z","repository":{"id":60123780,"uuid":"25216044","full_name":"openlandmap/africa-soil-and-agronomy-data-cube","owner":"openlandmap","description":"Accessing and using soil and agronomy data for Africa. See also: https://isda-africa.com/isdasoil","archived":false,"fork":false,"pushed_at":null,"size":null,"stargazers_count":7,"open_issues_count":4,"forks_count":3,"subscribers_count":null,"default_branch":"master","last_synced_at":"2026-01-03T01:11:09.311Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-sa-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://gitlab.com/uploads/-/system/project/avatar/25216044/africa_points.jpg","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-17T13:04:06.245Z","updated_at":"2023-01-12T15:22:34.571Z","dependencies_parsed_at":"2022-09-25T23:11:37.963Z","dependency_job_id":null,"html_url":"https://gitlab.com/openlandmap/africa-soil-and-agronomy-data-cube","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:gitlab/openlandmap/africa-soil-and-agronomy-data-cube","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/openlandmap%2Fafrica-soil-and-agronomy-data-cube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/openlandmap%2Fafrica-soil-and-agronomy-data-cube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/openlandmap%2Fafrica-soil-and-agronomy-data-cube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/openlandmap%2Fafrica-soil-and-agronomy-data-cube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/owners/openlandmap","download_url":"https://gitlab.com/openlandmap/africa-soil-and-agronomy-data-cube/-/archive/master/africa-soil-and-agronomy-data-cube-master.zip","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/openlandmap%2Fafrica-soil-and-agronomy-data-cube/sbom","scorecard":null,"host":{"name":"gitlab.com","url":"https://gitlab.com","kind":"gitlab","repositories_count":4521539,"owners_count":7348,"icon_url":"https://github.com/gitlab.png","version":null,"created_at":"2022-05-30T11:31:42.605Z","updated_at":"2026-01-12T22:45:04.389Z","status":"online","status_checked_at":"2026-03-27T02:00:08.384Z","response_time":261,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.382Z","robots_txt_url":"https://gitlab.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/owners"}},"owner":null,"packages":[],"commits":{"id":8372725,"full_name":"openlandmap/africa-soil-and-agronomy-data-cube","default_branch":"master","total_commits":11,"total_committers":1,"total_bot_commits":0,"total_bot_committers":0,"mean_commits":11.0,"dds":0.0,"past_year_total_commits":0,"past_year_total_committers":0,"past_year_total_bot_commits":0,"past_year_total_bot_committers":0,"past_year_mean_commits":0.0,"past_year_dds":0.0,"last_synced_at":"2026-04-13T19:51:11.064Z","last_synced_commit":"0a86acc2507fa7df1dfc8c695dbfc717f9e1ba9c","created_at":"2025-01-21T10:46:20.978Z","updated_at":"2026-04-13T19:51:10.912Z","committers":[{"name":"Tomislav Hengl","email":"tom.hengl@opengeohub.org","login":null,"count":11}],"past_year_committers":[],"commits_url":"https://commits.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/openlandmap%2Fafrica-soil-and-agronomy-data-cube/commits","host":{"name":"gitlab.com","url":"https://gitlab.com","kind":"gitlab","last_synced_at":"2026-04-14T00:00:08.033Z","repositories_count":23886,"commits_count":4154450,"contributors_count":114335,"owners_count":12297,"icon_url":"https://github.com/gitlab.png","host_url":"https://commits.ecosyste.ms/api/v1/hosts/gitlab.com","repositories_url":"https://commits.ecosyste.ms/api/v1/hosts/gitlab.com/repositories"}},"issues_stats":{"full_name":"openlandmap/africa-soil-and-agronomy-data-cube","html_url":"https://gitlab.com/openlandmap/africa-soil-and-agronomy-data-cube","last_synced_at":"2026-04-12T13:00:20.289Z","status":"error","issues_count":null,"pull_requests_count":null,"avg_time_to_close_issue":null,"avg_time_to_close_pull_request":null,"issues_closed_count":null,"pull_requests_closed_count":null,"pull_request_authors_count":null,"issue_authors_count":null,"avg_comments_per_issue":null,"avg_comments_per_pull_request":null,"merged_pull_requests_count":null,"bot_issues_count":null,"bot_pull_requests_count":null,"past_year_issues_count":null,"past_year_pull_requests_count":null,"past_year_avg_time_to_close_issue":null,"past_year_avg_time_to_close_pull_request":null,"past_year_issues_closed_count":null,"past_year_pull_requests_closed_count":null,"past_year_pull_request_authors_count":null,"past_year_issue_authors_count":null,"past_year_avg_comments_per_issue":null,"past_year_avg_comments_per_pull_request":null,"past_year_bot_issues_count":null,"past_year_bot_pull_requests_count":null,"past_year_merged_pull_requests_count":null,"created_at":"2025-01-20T13:00:08.887Z","updated_at":"2026-04-12T13:00:20.289Z","repository_url":"https://issues.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/openlandmap%2Fafrica-soil-and-agronomy-data-cube","issues_url":"https://issues.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/openlandmap%2Fafrica-soil-and-agronomy-data-cube/issues","issue_labels_count":{},"pull_request_labels_count":{},"issue_author_associations_count":{},"pull_request_author_associations_count":{},"issue_authors":{},"pull_request_authors":{},"host":{"name":"gitlab.com","url":"https://gitlab.com","kind":"gitlab","last_synced_at":"2026-04-14T00:00:07.968Z","repositories_count":0,"issues_count":0,"pull_requests_count":0,"authors_count":61892,"icon_url":"https://github.com/gitlab.png","host_url":"https://issues.ecosyste.ms/api/v1/hosts/gitlab.com","repositories_url":"https://issues.ecosyste.ms/api/v1/hosts/gitlab.com/repositories","owners_url":"https://issues.ecosyste.ms/api/v1/hosts/gitlab.com/owners","authors_url":"https://issues.ecosyste.ms/api/v1/hosts/gitlab.com/authors"},"past_year_issue_labels_count":{},"past_year_pull_request_labels_count":{},"past_year_issue_author_associations_count":{},"past_year_pull_request_author_associations_count":{},"past_year_issue_authors":{},"past_year_pull_request_authors":{},"maintainers":[],"active_maintainers":[]},"events":null,"keywords":[],"dependencies":[],"score":2.3978952727983707,"created_at":"2025-01-20T13:00:05.641Z","updated_at":"2026-04-14T14:00:32.228Z","avatar_url":"https://gitlab.com/uploads/-/system/project/avatar/25216044/africa_points.jpg","language":null,"category":"Sustainable Development","sub_category":"Education","monthly_downloads":0,"total_dependent_repos":0,"total_dependent_packages":0,"readme":"Africa Soil and Agronomy Data Cube (tutorial)\n================\nCreated and maintained by: Tom Hengl (\u003ctom.hengl@envirometrix.net\u003e) \\|\nLast compiled on: 12 January, 2023\n\n\n\n- \u003ca href=\"#alt-text-introduction\" id=\"toc-alt-text-introduction\"\u003e\u003cimg\n  src=\"tex/R_logo.svg.png\" title=\"About\" alt=\"alt text\" /\u003e\n  Introduction\u003c/a\u003e\n  - \u003ca href=\"#purpose-of-this-tutorial\"\n    id=\"toc-purpose-of-this-tutorial\"\u003ePurpose of this tutorial\u003c/a\u003e\n  - \u003ca href=\"#listing-all-layers-available\"\n    id=\"toc-listing-all-layers-available\"\u003eListing all layers available\u003c/a\u003e\n  - \u003ca href=\"#opening-data-in-qgis\" id=\"toc-opening-data-in-qgis\"\u003eOpening\n    data in QGIS\u003c/a\u003e\n- \u003ca href=\"#alt-text-computing-with-cog-in-r\"\n  id=\"toc-alt-text-computing-with-cog-in-r\"\u003e\u003cimg src=\"tex/R_logo.svg.png\"\n  title=\"Computing\" alt=\"alt text\" /\u003e Computing with COG in R\u003c/a\u003e\n  - \u003ca href=\"#crop-maps-and-get-values-for-polygons-of-interest\"\n    id=\"toc-crop-maps-and-get-values-for-polygons-of-interest\"\u003eCrop maps and\n    get values for polygons of interest\u003c/a\u003e\n  - \u003ca href=\"#calculate-stocks-in-tha\"\n    id=\"toc-calculate-stocks-in-tha\"\u003eCalculate stocks in t/ha\u003c/a\u003e\n  - \u003ca href=\"#aggregate-values-for-different-land-cover-classes\"\n    id=\"toc-aggregate-values-for-different-land-cover-classes\"\u003eAggregate\n    values for different land cover classes\u003c/a\u003e\n  - \u003ca href=\"#generate-sampling-plan-using-the-mapping-uncertainty\"\n    id=\"toc-generate-sampling-plan-using-the-mapping-uncertainty\"\u003eGenerate\n    sampling plan using the mapping uncertainty\u003c/a\u003e\n  - \u003ca href=\"#building-a-spatial-model-to-explain-cropland-distribution\"\n    id=\"toc-building-a-spatial-model-to-explain-cropland-distribution\"\u003eBuilding\n    a spatial model to explain cropland distribution\u003c/a\u003e\n- \u003ca href=\"#alt-text-other-data-and-analysis-possibilities\"\n  id=\"toc-alt-text-other-data-and-analysis-possibilities\"\u003e\u003cimg\n  src=\"tex/R_logo.svg.png\" title=\"About\" alt=\"alt text\" /\u003e Other data and\n  analysis possibilities\u003c/a\u003e\n  - \u003ca href=\"#other-analysis-possibilities\"\n    id=\"toc-other-analysis-possibilities\"\u003eOther analysis possibilities\u003c/a\u003e\n  - \u003ca href=\"#other-data-sources-for-africa\"\n    id=\"toc-other-data-sources-for-africa\"\u003eOther data sources for Africa\u003c/a\u003e\n  - \u003ca href=\"#acknowledgments\" id=\"toc-acknowledgments\"\u003eAcknowledgments\u003c/a\u003e\n  - \u003ca href=\"#help-improve-the-africa-soil-property-and-nutrient-maps\"\n    id=\"toc-help-improve-the-africa-soil-property-and-nutrient-maps\"\u003eHelp\n    improve the Africa soil property and nutrient maps!\u003c/a\u003e\n- \u003ca href=\"#references\" id=\"toc-references\"\u003eReferences\u003c/a\u003e\n\n[\u003cimg alt=\"Creative Commons License\" style=\"border-width:0\" src=\"https://i.creativecommons.org/l/by-sa/4.0/88x31.png\" /\u003e](http://creativecommons.org/licenses/by-sa/4.0/)\n\nThis work is licensed under a [Creative Commons Attribution-ShareAlike\n4.0 International\nLicense](http://creativecommons.org/licenses/by-sa/4.0/).\n\n## ![alt text](tex/R_logo.svg.png \"About\") Introduction\n\n#### Purpose of this tutorial\n\nThis data processing tutorial explains how to: (1) access various land\ncover, soil, terrain and climatic layers for whole of Africa and at\nvarious resolutions (from 30-m to 1-km), (2) use the data to derive\nstocks, (3) aggregate per land cover class and/or admin units, and (4)\ngenerate sampling designs using different algorithms and aiming at\nimproving accuracy of predictions (locally). A more general tutorial\nexplaining how to access global layers (Cloud-Optimized GeoTIFFs) from\nwww.OpenLandMap.org is available\n[**here**](https://gitlab.com/openlandmap/global-layers/-/blob/master/tutorial/OpenLandMap_COG_tutorial.md).\nA detailed tutorial on how to derive nutrient defficiencies is available\n[**here**](https://github.com/iSDA-Africa/isdasoil-tutorial).\n\nThe main source of data used in this tutorial include:\n\n- [**iSDAsoil**](https://isda-africa.com/isdasoil) layers representing\n  soil properties and nutrients at two standard depth intervals 0–20 and\n  20–50 cm,\n- **Sentinel-2 cloud-free mosaics** (prepared for the purpose of\n  iSDAsoil project),\n- **Digital Terrain Model (DTM)** based on ALOS AW3D30 and NASADEM and\n  DTM derivatives (prepared for the purpose of iSDAsoil project),\n- [**OpenLandMap layers**](https://openlandmap.org) (from 250-m to 1-km\n  resolution),\n- [Population map of Africa for 2018 at 30-m\n  resolution](https://data.humdata.org/dataset/dbd7b22d-7426-4eb0-b3c4-faa29a87f44b)\n  (Facebook Connectivity Lab and Center for International Earth Science\n  Information Network — CIESIN — Columbia University. 2016. High\n  Resolution Settlement Layer HRSL);\n\nTo cite iSDAsoil layers and the auxiliary data documented in this\ntutorial please use:\n\n- Hengl, T., Miller, M.A.E., Križan, J. et al. (2021) **African soil\n  properties and nutrients mapped at 30 m spatial resolution using\n  two-scale ensemble machine learning**. Sci Rep 11, 6130.\n  \u003chttps://doi.org/10.1038/s41598-021-85639-y\u003e\n\nPredictive modeling using 2–scale framework is also documented in detail\n[here](https://gitlab.com/openlandmap/spatial-predictions-using-eml).\nProduction of the iSDAsoil dataset and app is discussed in detail in\nthis\n[article](https://medium.com/isda-africa/soil-science-and-smallholders-the-contribution-of-soil-to-sustainable-african-agriculture-35a1f67c19a8).\n\nIf you prefer to use **python** for processing Cloud-Optimized GeoTIFFs,\nplease refer to [this\ntutorial](https://gitlab.com/geoharmonizer_inea/eumap/-/blob/master/demo/python/05_cloud_optimized_geotiff.ipynb).\nThe \u003chttps://github.com/iSDA-Africa/\u003e repository also contains examples\nwith iSDAsoil worked out in python.\n\n*Important note*: We do **NOT** recommend downloading whole GeoTIFFs of\nAfrica at 30-m resolution as these are usually 10–20GB in size (per\nfile). The total size of the repository at the moment exceeds 1.5TB.\nInstead, if you need to analyze whole land mask of Africa, we recommend\ndownloading the files directly from\n[**zenodo.org**](https://zenodo.org/search?page=1\u0026size=20\u0026q=isdasoil)\nand/or [Amazon AWS](https://www.isda-africa.com/isdasoil/). Also note\nthat nutrient stocks and aggregated soil properties can be derived using\nvariety of procedures (see e.g. Hengl \u0026 MacMillan\n([2019](#ref-hengl2019predictive))) and the total values might\neventually differ.\n\nIf you discover an issue or a bug please report.\n\n#### Listing all layers available\n\nTo list all layers available at 30-m resolution for whole of Africa\nplease use [**this table**](./csv/wasabi-africa-soil.csv). To list all\nlayers available at 250-m resolution (global land mask) please use\n[**this\ntable**](https://gitlab.com/openlandmap/global-layers/-/tree/master/tables/openlandmap_wasabi_files.csv).\nNote: the file versions might change hence your code would need to be\nupdated. Please subscribe to this repository or refer to\n\u003chttps://isda-africa.com\u003e for the most up-to-date information about\niSDAsoil.\n\nThe Sentinel mosaics for Africa (prepared by\n[MultiOne.hr](https://multione.hr)) are relatively large in size and\nmight still contain artifacts between scenes and missing values beyond\nwater bodies etc. The population density map at 30-m spatial resolution\ndoes **NOT** include some areas such as Sudan’s and Somalia.\n\n#### Opening data in QGIS\n\nBefore you start running any type of analysis, we recommend that you\nfirst visualize the data using QGIS and familiarize yourself with it.\nZoom in on the area of interest and see if you can observe any potential\nproblems with that data such as:\n\n- inconsistent land / water mask,\n- incorrect missing value flag,\n- measurement units not matching the description,\n- spatial patterns not matching the description,\n\nTo add any of the layers listed above follow these steps in QGIS:\n\n- Select *“Layer”* –\\\u003e *“Add Layer”* –\\\u003e *“Add Raster layer”*;\n- Select *“Source Type”* –\\\u003e *“Protocol HTTP(s)/Cloud”*;\n- Enter the URL of the layer and leave *“No authentication”*;\n\nExample of a URL for the soil texture layer is:\n\n    https://s3.eu-central-1.wasabisys.com/africa-soil/layers30m/\n        sol_texture.class_m_30m_20..50cm_2001..2017_africa_epsg4326_v0.1.tif\n\nTo attach some applicable QGIS legend, you can use the global soil data\nlegends available via the\n[OpenLandMap.org](https://gitlab.com/openlandmap/global-layers/-/tree/master/SLD).\nThis is an example of the layer visualized in QGIS:\n\n\u003cimg src=\"img/preview_isdasoil_qgis.png\" width=\"650\" /\u003e\n\n*Figure: iSDAsoil layers (soil texture class) visualized in QGIS.*\n\nSee also the [geo-harmonizer\ntutorial](https://opendatascience.eu/geo-harmonizer/geospatial-data-tutorial/)\nfor more details about how to use COG files in QGIS.\n\nTo visualize Sentinel-2 cloud-free bands for Africa, you can use e.g.:\n\n    https://s3.eu-central-1.wasabisys.com/africa-soil/layers30m/\n        lcv_b8a_sentinel.s2l2a_d_30m_s0..0cm_2018..2019.s22_africa_proj.laea_v0.1.tif\n\nThis is basically 25% probability quantile range for the Sentinel S2L2a\nband B8A computed from some 20TB of input data for the season 2 for\nyears 2018 and 2019 using the Amazon AWS Sentinel-2 service. To learn\nmore about how were the Sentinel-2 mosaics produced, please refer to\nHengl et al. ([2021](#ref-hengl2021african)).\n\n\u003cimg src=\"img/example_Sentinel_image_africa.jpg\" width=\"650\" /\u003e\n\n*Figure: Sentinel-2 mosaic for Africa visualized in QGIS (left), zoom-in\non the farm plot in South Africa (right).*\n\n## ![alt text](tex/R_logo.svg.png \"Computing\") Computing with COG in R\n\n#### Crop maps and get values for polygons of interest\n\nTo crop maps of interest for the area of interest we recommend using the\n**rgdal** and **terra** packages ([Hijmans, Bivand, Forner, Ooms, \u0026\nPebesma, 2020](#ref-hijmans2020package)). Consider, for example, a\npolygon map representing a 1-square-km farm in South Africa and covering\ndiversity of agricultural fields:\n\n``` r\nlibrary(rgdal)\n```\n\n    ## Loading required package: sp\n\n    ## rgdal: version: 1.5-12, (SVN revision 1018)\n    ## Geospatial Data Abstraction Library extensions to R successfully loaded\n    ## Loaded GDAL runtime: GDAL 3.4.3, released 2022/04/22\n    ## Path to GDAL shared files: /usr/share/gdal\n    ## GDAL binary built with GEOS: TRUE \n    ## Loaded PROJ runtime: Rel. 8.2.0, November 1st, 2021, [PJ_VERSION: 820]\n    ## Path to PROJ shared files: /home/tomislav/.local/share/proj:/usr/share/proj\n    ## PROJ CDN enabled:FALSE\n    ## Linking to sp version:1.4-4\n    ## To mute warnings of possible GDAL/OSR exportToProj4() degradation,\n    ## use options(\"rgdal_show_exportToProj4_warnings\"=\"none\") before loading rgdal.\n\n``` r\nlibrary(terra)\n```\n\n    ## terra 1.6.51\n\n    ## \n    ## Attaching package: 'terra'\n\n    ## The following object is masked from 'package:rgdal':\n    ## \n    ##     project\n\n``` r\nlibrary(raster)\npol = readOGR(\"./data/farm_example.kmz\")\n```\n\n    ## OGR data source with driver: LIBKML \n    ## Source: \"/home/tomislav/Documents/git/africa-soil-and-agronomy-data-cube/data/farm_example.kmz\", layer: \"farm_example.kmz\"\n    ## with 1 features\n    ## It has 11 fields\n\n``` r\npol.v \u003c- vect(pol)\n```\n\n\u003cimg src=\"img/example_soilfarm_ge.jpg\" width=\"750\" /\u003e\n\n*Figure: Polygon for a farm digitized in Google Earth.*\n\nWe can access and crop Potassium concentrations for the area of interest\nby using:\n\n``` r\ntif.cog = paste0(\"/vsicurl/https://s3.eu-central-1.wasabisys.com/africa-soil/layers30m/\", \n               c(\"sol_log.k_mehlich3_m_30m_0..20cm_2001..2017_africa_epsg4326_v0.1.tif\",\n               \"sol_log.k_mehlich3_md_30m_0..20cm_2001..2017_africa_epsg4326_v0.1.tif\",\n               \"sol_log.k_mehlich3_m_30m_20..50cm_2001..2017_africa_epsg4326_v0.1.tif\",\n               \"sol_log.k_mehlich3_md_30m_20..50cm_2001..2017_africa_epsg4326_v0.1.tif\"))\n```\n\nwhere `_m_30m_0..20cm` and `_m_30m_20..50cm` are the predicted\nextractable K in log-scale, and `_md_30m_0..20cm` and `_md_30m_20..50cm`\nare associated prediction errors (1-std).\n\nWe can load the values to R by using:\n\n``` r\nsol30m = lapply(tif.cog, function(i){terra::crop(rast(i), pol.v)})  \nsol30m.sp = do.call(cbind, lapply(sol30m, function(i){as.data.frame(i)}))\nstr(sol30m.sp)\n```\n\n    ## 'data.frame':    1560 obs. of  4 variables:\n    ##  $ sol_log.k_mehlich3_m_30m_0..20cm_2001..2017_africa_epsg4326_v0.1  : int  46 46 46 45 47 46 46 46 45 45 ...\n    ##  $ sol_log.k_mehlich3_md_30m_0..20cm_2001..2017_africa_epsg4326_v0.1 : int  6 5 6 5 5 5 5 5 5 5 ...\n    ##  $ sol_log.k_mehlich3_m_30m_20..50cm_2001..2017_africa_epsg4326_v0.1 : int  44 44 43 43 44 44 44 44 44 44 ...\n    ##  $ sol_log.k_mehlich3_md_30m_20..50cm_2001..2017_africa_epsg4326_v0.1: int  5 5 6 5 5 5 5 4 4 4 ...\n\nNext, we need to back-transform values from log-scale to ppms:\n\n``` r\nsol30m.sp$k_mehlich3_l1 = expm1(sol30m.sp$sol_log.k_mehlich3_m_30m_0..20cm_2001..2017_africa_epsg4326_v0.1 / 10)\nsol30m.sp$k_mehlich3_l2 = expm1(sol30m.sp$sol_log.k_mehlich3_m_30m_20..50cm_2001..2017_africa_epsg4326_v0.1 / 10)\n```\n\nCrop to the area of interest using the polygon map:\n\n``` r\npol.r = terra::rasterize(pol.v, sol30m[[1]])\nsol30m.m = as(as(raster(pol.r), \"SpatialGridDataFrame\"), \"SpatialPixelsDataFrame\")\nsol30m.m$k_mehlich3_l1 = sol30m.sp$k_mehlich3_l1[sol30m.m@grid.index]\nsol30m.m$k_mehlich3_l2 = sol30m.sp$k_mehlich3_l2[sol30m.m@grid.index]\n```\n\nWe can finally plot extractable Potassium (K) values for the farm for\ntwo depth intervals (`l1` = 0–20-cm and `l2` = 20–50-cm) using:\n\n``` r\nspplot(sol30m.m[c(\"k_mehlich3_l1\",\"k_mehlich3_l2\")])\n```\n\n\u003cimg src=\"README_files/figure-gfm/map-log.k-1.png\" title=\"Extractable Potassium in ppm for top and sub-soil.\" alt=\"Extractable Potassium in ppm for top and sub-soil.\" width=\"70%\" /\u003e\n\nAccording to the FAO guidelines ([Roy, Finck, Blair, \u0026 Tandon,\n2006](#ref-roy2006plant)) K concentration ranging from 0–50-ppm is very\nlow (\\\u003c50% expected yield), 50–100 is low, 100–175 is medium (80–100%\nyield) and \\\u003e175 is high (100% yield).\n\n#### Calculate stocks in t/ha\n\nIn the previous examples we have downloaded and cropped images with\npredictions of Potassium (K) in ppm. We would next like to derive total\nstocks per farm. For this we need to also download bulk density and\ncoarse fragments maps and import them into session:\n\n``` r\nbld.cog = paste0(\"/vsicurl/https://s3.eu-central-1.wasabisys.com/africa-soil/layers30m/\", \n               c(\"sol_db_od_m_30m_0..20cm_2001..2017_africa_epsg4326_v0.1.tif\",\n               \"sol_log.wpg2_m_30m_0..20cm_2001..2017_africa_epsg4326_v0.1.tif\"))\nbld30m = lapply(bld.cog, function(i){crop(rast(i), pol.v)})  \nbld30m.sp = do.call(cbind, lapply(bld30m, function(i){as.data.frame(i)}))\nbld30m.sp$bld_l1 = bld30m.sp$sol_db_od_m_30m_0..20cm_2001..2017_africa_epsg4326_v0.1 * 10\nbld30m.sp$wpg_l1 = expm1(bld30m.sp$sol_log.wpg2_m_30m_0..20cm_2001..2017_africa_epsg4326_v0.1 / 10)\n```\n\nNext, we convert the values from ppm to kg/m-square by using ([Hengl \u0026\nMacMillan, 2019](#ref-hengl2019predictive)):\n\n``` r\nsol30m.m$k_mehlich3_l1s = sol30m.m$k_mehlich3_l1/1e6 * \n       bld30m.sp$bld_l1[sol30m.m@grid.index] * \n       (1 - bld30m.sp$wpg_l1[sol30m.m@grid.index]/100) * 0.2\nsummary(sol30m.m$k_mehlich3_l1s)\n```\n\n    ##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. \n    ## 0.01903 0.02358 0.02501 0.02545 0.02715 0.03385\n\nTo derive total stocks in kg, we need to resample the summary map to\nequal area projection so we can estimate areas in square-m. One suitable\nprojection system for this is the [Lambert Azimuthal Equal Area\nprojection system](https://proj.org/operations/projections/laea.html):\n\n``` r\nprj.laea = \"+proj=laea +lat_0=5 +lon_0=20 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0\"\npol.xy = project(pol.v, prj.laea)\nr30m = rast(ext(pol.xy), crs=prj.laea, resolution=30)\nsol30m.s = project(rast(raster(sol30m.m[\"k_mehlich3_l1s\"])), r30m)\nplot(sol30m.s)\n```\n\n\u003cimg src=\"README_files/figure-gfm/map-stock-1.png\" title=\"Potassium stock in kg/m-square for top-soil.\" alt=\"Potassium stock in kg/m-square for top-soil.\" width=\"70%\" /\u003e\n\nSo the total stock for the whole farm for 0–20-cm depth in tonnes is:\n\n``` r\nsum(as.data.frame(sol30m.s)*30^2, na.rm=TRUE)/1e3\n```\n\n    ## [1] 22.44592\n\n#### Aggregate values for different land cover classes\n\nTo aggregate values for different land cover classes (see also [these\nworked out examples in\nR](https://soilmapper.org/SOC-chapter.html#predicting-ocs-from-point-data-the-2d-approach))\nwe have to also download the land cover map. We can use for this purpose\nthe [Copernicus land cover map derived for year 2016 at 20-m spatial\nresolution](https://www.esa.int/ESA_Multimedia/Images/2017/10/African_land_cover)\n(important note: this product is discontinued and should be only used\nfor testing purposes):\n\n``` r\nlcv.cog = paste0(\"/vsicurl/https://s3.eu-central-1.wasabisys.com/africa-soil/layers30m/\",\n                 \"lcv_land.cover_esa.cci.l4_m_30m_s0..0cm_2016_africa_proj.laea_v0.1.tif\")\n#GDALinfo(lcv.cog)\n```\n\nWe can clip the same polygon using:\n\n``` r\nlcv30m = crop(rast(lcv.cog), pol.xy)\n```\n\nWe can check the nutrient stocks per land cover class by using:\n\n``` r\nsol30m.sxy = as(as(raster(sol30m.s), \"SpatialGridDataFrame\"), \"SpatialPixelsDataFrame\")\nsol30m.sxy$lcv = as.factor(as.data.frame(lcv30m)[sol30m.sxy@grid.index,1])\nlibrary(plyr)\nsol_agg.lu \u003c- plyr::ddply(sol30m.sxy@data, .(lcv), summarize,\n                          Total_K_kg=sum(k_mehlich3_l1s*30^2, na.rm=TRUE),\n                          Area_m2=sum(!is.na(k_mehlich3_l1s))*30^2)\nsol_agg.lu$Total_K_M = sol_agg.lu$Total_K/(sol_agg.lu$Area_m2)\nsol_agg.lu[,c(\"lcv\", \"Total_K_kg\", \"Area_m2\", \"Total_K_M\")]\n```\n\n    ##   lcv Total_K_kg Area_m2  Total_K_M\n    ## 1   1  1169.2628   42300 0.02764215\n    ## 2   2  1431.6753   52200 0.02742673\n    ## 3   3  1913.4636   68400 0.02797461\n    ## 4   4 17642.4259  707400 0.02493982\n    ## 5   5   111.2897    4500 0.02473104\n    ## 6   8   177.8013    7200 0.02469462\n\nwhich shows that the\n[class](./csv/ESACCI-LC_S2_Prototype_ColorLegend.csv) `3` (Grassland)\nhas the relatively highest K concentration.\n\n#### Generate sampling plan using the mapping uncertainty\n\nOne efficient way to generate sampling designs to improve maps of\nPotassium in soil is to use the existing error map, then sample\nproportionally to the prediction variance, collect new points and\nre-build prediction models until some required accuracy level is reached\n([Hengl, Nussbaum, Wright, Heuvelink, \u0026 Gräler,\n2018](#ref-hengl2018random)). This is referred to as\n*“uncertainty-guided sampling”* by Stumpf et al.\n([2017](#ref-stumpf2017uncertainty)) and is best illustrated by the\nfigure below.\n\n\u003cimg src=\"img/1-s2.0-S0341816217300401-gr2.jpg\" width=\"500\" /\u003e\n\n*Figure: Uncertainty-guided sampling based on [Stumpf et\nal. (2016)](https://dx.doi.org/10.1016/j.catena.2017.01.033). The first\nsample is used to build initial model, then the 2nd-round sampling\nfocuses on area of highest uncertainty and is used to rebuild the\nmodel.*\n\nThe uncertainty for mapping K for the farm above is (for top-soil):\n\n``` r\nunc.cog = paste0(\"/vsicurl/https://s3.eu-central-1.wasabisys.com/africa-soil/layers30m/\", \n               \"sol_log.k_mehlich3_md_30m_0..20cm_2001..2017_africa_epsg4326_v0.1.tif\")\nunc30m = terra::crop(rast(unc.cog), pol.v)\nunc30m.xy = project(unc30m, r30m, method=\"bilinear\")\npol.r.xy = rasterize(pol.xy, unc30m.xy)\nunc30m.m = as(raster(unc30m.xy), \"SpatialGridDataFrame\")\nunc30m.sp = as.data.frame(pol.r.xy)\nunc30m.m$var = unc30m.m$sol_log.k_mehlich3_md_30m_0..20cm_2001..2017_africa_epsg4326_v0.1^2\nunc30m.m = as(unc30m.m[\"var\"], \"SpatialPixelsDataFrame\")\n```\n\nWe can use the [spatstat](https://spatstat.org/) package to sample\nproportionally to prediction variance (i.e. use the prediction variance\nas weight map):\n\n``` r\nlibrary(spatstat)\n```\n\n    ## Loading required package: spatstat.data\n\n    ## Loading required package: spatstat.geom\n\n    ## spatstat.geom 2.4-0\n\n    ## \n    ## Attaching package: 'spatstat.geom'\n\n    ## The following objects are masked from 'package:raster':\n    ## \n    ##     area, rotate, shift\n\n    ## The following objects are masked from 'package:terra':\n    ## \n    ##     area, delaunay, rescale, rotate, shift, where.max, where.min\n\n    ## Loading required package: spatstat.random\n\n    ## spatstat.random 2.2-0\n\n    ## Loading required package: spatstat.core\n\n    ## Loading required package: nlme\n\n    ## \n    ## Attaching package: 'nlme'\n\n    ## The following object is masked from 'package:raster':\n    ## \n    ##     getData\n\n    ## Loading required package: rpart\n\n    ## spatstat.core 2.4-2\n\n    ## Loading required package: spatstat.linnet\n\n    ## spatstat.linnet 2.3-2\n\n    ## \n    ## spatstat 2.3-4       (nickname: 'Watch this space') \n    ## For an introduction to spatstat, type 'beginner'\n\n``` r\ndens.var \u003c- as.im(as.image.SpatialGridDataFrame(unc30m.m[\"var\"]))\nextra.pnts \u003c- rpoint(40, f=dens.var)\nplot(raster(unc30m.m))\npoints(extra.pnts$x, extra.pnts$y)\n```\n\n\u003cimg src=\"README_files/figure-gfm/map-unc-1.png\" title=\"New simulated random samples based on the prediction error.\" alt=\"New simulated random samples based on the prediction error.\" width=\"70%\" /\u003e\n\nIn this case the prediction errors (variance) is higher towards the\nwestern side of farm, and consequently more point samples are put in\nthat part. Alternatively, one could also setup a threshold prediction\nerror, then ONLY sample in the areas where the error is above certain\nvalue by using [Latin Hypercube\nSampling](https://cran.r-project.org/web/packages/lhs/vignettes/lhs_basics.html)\nor similar (method explained in Stumpf et al.\n([2017](#ref-stumpf2017uncertainty))).\n\nTo plot the points in Google Earth, you can run:\n\n``` r\nlibrary(plotKML)\n```\n\n    ## plotKML version 0.8-2 (2021-10-16)\n\n    ## URL: https://github.com/Envirometrix/plotKML/\n\n``` r\npnts.xy = SpatialPoints(coords=data.frame(extra.pnts$x, extra.pnts$y), \n                        proj4string = CRS(proj4string(unc30m.m)))\nshape = \"http://maps.google.com/mapfiles/kml/pal2/icon18.png\"\n# color only:\nkml(pnts.xy, file.name=\"./data/extra.pnts.kml\", shape = shape, labels = \"\")\n```\n\n    ## KML file opened for writing...\n\n    ## Reprojecting to +proj=longlat +datum=WGS84 +no_defs ...\n\n    ## Writing to KML...\n\n    ## Closing  ./data/extra.pnts.kml\n\n#### Building a spatial model to explain cropland distribution\n\nIn the following example we focus on modeling cropland distribution in\nEthiopia. Because loading all data at 30-m spatial resolution is\nprobably not a good idea for processing on a laptop or desktop computer,\nwe can instead focus on a coarser resolution e.g. 1-km.\n\nFirst, we load the admin boundaries using the [NaturalEarth\ndata](https://cran.r-project.org/web/packages/rnaturalearth/vignettes/rnaturalearth.html)\nand prepare the target grid:\n\n``` r\nlibrary(rnaturalearth)\n#devtools::install_github(\"ropensci/rnaturalearthhires\")\nlibrary(sp)\net = ne_states(geounit=\"ethiopia\")\net.xy = project(vect(et), prj.laea)\n#plot(et)\net1km = rast(ext(et.xy), resolution=1000, crs=prj.laea)\net1km\n```\n\n    ## class       : SpatRaster \n    ## dimensions  : 1278, 1624, 1  (nrow, ncol, nlyr)\n    ## resolution  : 1000, 1000  (x, y)\n    ## extent      : 1429621, 3053621, -147033.2, 1130967  (xmin, xmax, ymin, ymax)\n    ## coord. ref. : +proj=laea +lat_0=5 +lon_0=20 +x_0=0 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs\n\n``` r\net1km.m = rasterize(et.xy, et1km)\n```\n\nNext we need to resample and crop all layers of interest by using GDAL.\nWe first list layers of interest:\n\n``` r\net.cog = paste0(\"/vsicurl/https://s3.eu-central-1.wasabisys.com/africa-soil/layers30m/\",\n                 c(\"dtm_slope_aw3d30.nasadem_m_30m_s0..0cm_2017_africa_proj.laea_v0.1.tif\",\n                \"dtm_elevation_aw3d30.nasadem_m_30m_s0..0cm_2017_africa_proj.laea_v0.1.tif\",\n                \"lcv_crops.coverfraction.layer_probav.lc100_p_30m_0..0cm_2019..2019_v3.0.1_africa_epsg4326.tif\",\n                \"sol_ph_h2o_m_30m_0..20cm_2001..2017_africa_epsg4326_v0.1.tif\",\n                \"sol_log.ecec.f_m_30m_0..20cm_2001..2017_africa_epsg4326_v0.1.tif\"))\nolm.cog = paste0(\"/vsicurl/https://s3.eu-central-1.wasabisys.com/openlandmap/layers1km/\",\n                 c(\"clm_precipitation_sm2rain.dec_m_1km_s0..0cm_2007..2018_v0.2.tif\",\n                 \"clm_precipitation_sm2rain.jun_m_1km_s0..0cm_2007..2018_v0.2.tif\",\n                 \"clm_precipitation_sm2rain.mar_m_1km_s0..0cm_2007..2018_v0.2.tif\",\n                 \"clm_precipitation_sm2rain.sep_m_1km_s0..0cm_2007..2018_v0.2.tif\"))\n```\n\nSome layers might have a different projection system so we run\nreprojection and resampling by default:\n\n``` r\net.sp1km = as(as(raster(et1km.m), \"SpatialGridDataFrame\"), \"SpatialPixelsDataFrame\")\net.te = paste(round(as.vector(ext(et1km))[c(1,3,2,4)]), collapse =\" \")\ntif.loc = paste0(\"./data/\", basename(c(et.cog, olm.cog)))\nif(any(!file.exists(tif.loc))){\n  for(j in c(et.cog, olm.cog)){\n    system(paste0('gdalwarp ', j, ' ./data/', basename(j), ' -co \\\"COMPRESS=DEFLATE\\\"',\n              ' -t_srs \\\"', prj.laea, '\\\" -r \\\"average\\\" -te ', et.te, ' -tr 1000 1000'))\n  }\n}\n```\n\nWe can read the subset of layers (now available on our local drive)\nusing the mask map:\n\n``` r\nfor(j in tif.loc){ et.sp1km@data[,basename(j)]  \u003c- readGDAL(j)$band1[et.sp1km@grid.index] }\n```\n\n    ## ./data/dtm_slope_aw3d30.nasadem_m_30m_s0..0cm_2017_africa_proj.laea_v0.1.tif has GDAL driver GTiff \n    ## and has 1278 rows and 1624 columns\n    ## ./data/dtm_elevation_aw3d30.nasadem_m_30m_s0..0cm_2017_africa_proj.laea_v0.1.tif has GDAL driver GTiff \n    ## and has 1278 rows and 1624 columns\n    ## ./data/lcv_crops.coverfraction.layer_probav.lc100_p_30m_0..0cm_2019..2019_v3.0.1_africa_epsg4326.tif has GDAL driver GTiff \n    ## and has 1278 rows and 1624 columns\n    ## ./data/sol_ph_h2o_m_30m_0..20cm_2001..2017_africa_epsg4326_v0.1.tif has GDAL driver GTiff \n    ## and has 1278 rows and 1624 columns\n    ## ./data/sol_log.ecec.f_m_30m_0..20cm_2001..2017_africa_epsg4326_v0.1.tif has GDAL driver GTiff \n    ## and has 1278 rows and 1624 columns\n    ## ./data/clm_precipitation_sm2rain.dec_m_1km_s0..0cm_2007..2018_v0.2.tif has GDAL driver GTiff \n    ## and has 1278 rows and 1624 columns\n    ## ./data/clm_precipitation_sm2rain.jun_m_1km_s0..0cm_2007..2018_v0.2.tif has GDAL driver GTiff \n    ## and has 1278 rows and 1624 columns\n    ## ./data/clm_precipitation_sm2rain.mar_m_1km_s0..0cm_2007..2018_v0.2.tif has GDAL driver GTiff \n    ## and has 1278 rows and 1624 columns\n    ## ./data/clm_precipitation_sm2rain.sep_m_1km_s0..0cm_2007..2018_v0.2.tif has GDAL driver GTiff \n    ## and has 1278 rows and 1624 columns\n\nso that we can plot some of the maps e.g. [cropland cover fraction for\nyear 2019 based on GLC100m](https://lcviewer.vito.be/2015):\n\n``` r\nplot(raster(et.sp1km[4]))\nlines(et.xy)\n```\n\n\u003cimg src=\"README_files/figure-gfm/map-cropland-1.png\" title=\"Cropland map of Ethiopia for the year 2019.\" alt=\"Cropland map of Ethiopia for the year 2019.\" width=\"90%\" /\u003e\n\nWe can test if we can explain distribution of cropland in Ethiopia by\nusing terrain, soils, and rainfall only:\n\n``` r\nlibrary(ranger)\nfm.n = names(et.sp1km)[-1]\nfm.crop = as.formula(paste(fm.n[grep(\"crop\", fm.n)], \" ~ \", paste(fm.n[-grep(\"crop\", fm.n)], collapse = \"+\")))\nsel = complete.cases(et.sp1km@data[,all.vars(fm.crop)])\nm.crops = ranger(fm.crop, data=et.sp1km@data[sel,], num.trees=85, importance=\"impurity\")\n```\n\nWhich shows:\n\n``` r\nm.crops\n```\n\n    ## Ranger result\n    ## \n    ## Call:\n    ##  ranger(fm.crop, data = et.sp1km@data[sel, ], num.trees = 85,      importance = \"impurity\") \n    ## \n    ## Type:                             Regression \n    ## Number of trees:                  85 \n    ## Sample size:                      1084451 \n    ## Number of independent variables:  8 \n    ## Mtry:                             2 \n    ## Target node size:                 5 \n    ## Variable importance mode:         impurity \n    ## Splitrule:                        variance \n    ## OOB prediction error (MSE):       31.36133 \n    ## R squared (OOB):                  0.9136888\n\nThis shows that the cropland distribution in Ethiopia is systematically\ncontrolled by: (1) altitude, (2) rainfall in June and September, (3)\nsoil pH, and (4) slope:\n\n``` r\nvarImp = data.frame(m.crops$variable.importance)\nvarImp\n```\n\n    ##                                                                           m.crops.variable.importance\n    ## dtm_slope_aw3d30.nasadem_m_30m_s0..0cm_2017_africa_proj.laea_v0.1.tif                        29728238\n    ## dtm_elevation_aw3d30.nasadem_m_30m_s0..0cm_2017_africa_proj.laea_v0.1.tif                   125905292\n    ## sol_ph_h2o_m_30m_0..20cm_2001..2017_africa_epsg4326_v0.1.tif                                 29975380\n    ## sol_log.ecec.f_m_30m_0..20cm_2001..2017_africa_epsg4326_v0.1.tif                             27429178\n    ## clm_precipitation_sm2rain.dec_m_1km_s0..0cm_2007..2018_v0.2.tif                              32004779\n    ## clm_precipitation_sm2rain.jun_m_1km_s0..0cm_2007..2018_v0.2.tif                              50478226\n    ## clm_precipitation_sm2rain.mar_m_1km_s0..0cm_2007..2018_v0.2.tif                              26283621\n    ## clm_precipitation_sm2rain.sep_m_1km_s0..0cm_2007..2018_v0.2.tif                              65345821\n\nThese few environmental variables explain almost 90% of variability in\nthe cropland distribution in Ethiopia. We could use the model fitted\nabove to predict what would be cropland distribution in the future\ni.e. assuming different climate change scenarios and long term changes\nin monthly rainfall or similar. Consider for example a linear decrease\nin monthly rainfall of 30%:\n\n``` r\net.sp1km.f = et.sp1km[sel, m.crops$forest$independent.variable.names]\nsel.clm = grep(\"sm2rain\", names(et.sp1km.f))\nfor(i in sel.clm){\n  et.sp1km.f@data[,i] \u003c- et.sp1km.f@data[,i] * 0.7\n}\n```\n\nWe can predict the cropland distribution by using:\n\n``` r\ncrop.tif = \"./data/et_cropland_predicted_1km.tif\"\nif(!file.exists(crop.tif)){\n  crop.f = predict(m.crops, et.sp1km.f@data)\n  crop.sp = SpatialPixelsDataFrame(et.sp1km.f@coords, data=data.frame(response=crop.f$predictions),\n                                   proj4string = CRS(prj.laea))\n  writeGDAL(crop.sp, crop.tif, type = \"Byte\", mvFlag = 255, options = c(\"COMPRESS=DEFLATE\"))\n}\n```\n\n\u003cimg src=\"img/Fig_ethiopia_actual_vs_potential_cropland.jpg\" width=\"750\" /\u003e\n\n*Figure: Actual (left) versus potential (right) cropland cover assuming\nlinear drop in rainfall of 30%.*\n\nThis is just to demonstrate spatial analysis possibilities. In practice,\npredicting suitability of land using machine learning is more complex\nand should be designed carefully considering both ecological and\nsocio-economic parameters ([Møller, Mulder, Heuvelink, Jacobsen, \u0026\nGreve, 2021](#ref-agronomy11040703)).\n\n## ![alt text](tex/R_logo.svg.png \"About\") Other data and analysis possibilities\n\n#### Other analysis possibilities\n\nOther analysis possibilities with the iSDAsoil and other 30-m resolution\nlayers include:\n\n- Overlay yield data (farm plots or individual 30✕30-m pixels) and fit a\n  regression model / try to model yields using soil terrain and climate\n  parameters ([Hengl et al., 2017](#ref-hengl2017soil)),\n- Derive soil organic carbon stock in the soil in kg/m-square and\n  associated (propagated) uncertainty,\n- Use the land cover and population density maps at county level and\n  derive soil nutrient deficiencies and how they relate to different\n  land cover classes and population densities ([Berkhout, Malan, \u0026 Kram,\n  2019](#ref-berkhout2019better)),\n- Aggregate values spatially using `gdalwarp` to e.g. 1-km spatial\n  resolution and observe patterns per country,\n\n#### Other data sources for Africa\n\nOther data sources (not included in this Data Cube) and data portals for\nAfrica with Earth Observation and similar data sets:\n\n- **Planet NICFI** (\u003chttps://www.planet.com/nicfi/\u003e): you can download\n  the 5-meter resolution ARD imagery (sub-Sahara Africa only and\n  CC-NC-Alike license only; project financed by the [Norwegian\n  Government](https://www.nicfi.no/current/new-satellite-images-to-allow-anyone-anywhere-to-monitor-tropical-deforestation/));\n- **Digital Earth Africa** (\u003chttps://www.digitalearthafrica.org/\u003e):\n  provides access to a map viewer and a sandbox to derive various\n  products per farm / polygon (project funded by US-based Leona M. and\n  Harry B. Helmsley Charitable Trust and the Australian Government);\n- Africa Regional Data Cube **ARDC**\n  (\u003chttps://www.data4sdgs.org/index.php/initiatives/africa-regional-data-cube\u003e):\n  provides various EO-based data products for Ghana, Kenya, Sierra\n  Leone, Senegal, and Tanzania;\n- **AfriAlliance** Africa-EU innovation alliance\n  (\u003chttps://afrialliance.org/\u003e): aims at providing\n  climatic/meteorological and hydrological information;\n\n\u003cimg src=\"img/preview_planet_5m_resolution_images.jpg\" width=\"750\" /\u003e\n\n*Figure: 5-m spatial resolution imagery is available publicly via the\nPlanet Explorer.*\n\nHave in mind that the 3rd party data might be: (1) of different spatial\nresolution, (2) covering different time-periods (not overlapping in\ntime), (3) of different accuracy including location accuracy.\nConsequently they might be incompatible with the Cloud-Optimized\nGeoTIFFs listed in this tutorial.\n\n#### Acknowledgments\n\n[Innovative Solutions for Decision Agriculture Ltd\n(iSDA)](https://isda-africa.com) is a social enterprise with the mission\nto improve smallholder farmer profitability across Africa. iSDA builds\non the legacy of the African Soils information service (AfSIS) project.\nWe are grateful for the outputs generated by all former AfSIS project\npartners: Columbia University, Rothamsted Research, World Agroforestry\n(ICRAF), Quantitative Engineering Design (QED), ISRIC — World Soil\nInformation, International Institute of Tropical Agriculture (IITA),\nEthiopia Soil Information Service (EthioSIS), Ghana Soil Information\nService (GhaSIS), Nigeria Soil Information Service (NiSIS) and Tanzania\nSoil Information Service (TanSIS). More details on AfSIS partners and\ndata contributors can be found at \u003chttps://isda-africa.com/isdasoil\u003e\n\n#### Help improve the Africa soil property and nutrient maps!\n\nIf you are a soil data producer or are aware of soil profile, soil\nsample data described in literature or reports, please contact us so\nthat we can add those points in the next major update of maps. We would\nattribute your contribution and provide support with translating the\npoint data to analysis-ready data. Please contribute your point data and\nhelp make better predictions of soil / land resources in Africa.\n\n- Contact for the iSDAsoil:\n  \u003chttps://www.isda-africa.com/isdasoil/faqs/\u003e;\n\nOnce your point data is added to the bulk of the training data, we will\nuse it to improve predictions and then notice you of the improvements.\n\n## References\n\n\u003cdiv id=\"refs\" class=\"references csl-bib-body hanging-indent\"\nline-spacing=\"2\"\u003e\n\n\u003cdiv id=\"ref-berkhout2019better\" class=\"csl-entry\"\u003e\n\nBerkhout, E. D., Malan, M., \u0026 Kram, T. (2019). \u003cspan\nclass=\"nocase\"\u003eBetter soils for healthier lives? An econometric\nassessment of the link between soil nutrients and malnutrition in\nSub-Saharan Africa\u003c/span\u003e. *PloS One*, *14*(1), e0210642.\n\n\u003c/div\u003e\n\n\u003cdiv id=\"ref-hengl2017soil\" class=\"csl-entry\"\u003e\n\nHengl, T., Leenaars, J. G., Shepherd, K. D., Walsh, M. G., Heuvelink, G.\nB., Mamo, T., et al.others. (2017). \u003cspan class=\"nocase\"\u003eSoil nutrient\nmaps of Sub-Saharan Africa: assessment of soil nutrient content at 250 m\nspatial resolution using machine learning\u003c/span\u003e. *Nutrient Cycling in\nAgroecosystems*, *109*(1), 77–102.\ndoi:[10.1007/s10705-017-9870-x](https://doi.org/10.1007/s10705-017-9870-x)\n\n\u003c/div\u003e\n\n\u003cdiv id=\"ref-hengl2019predictive\" class=\"csl-entry\"\u003e\n\nHengl, T., \u0026 MacMillan, R. A. (2019). *\u003cspan class=\"nocase\"\u003ePredictive\nsoil mapping with R\u003c/span\u003e* (p. 370). Lulu. com. Retrieved from\n\u003chttps://soilmapper.org\u003e\n\n\u003c/div\u003e\n\n\u003cdiv id=\"ref-hengl2021african\" class=\"csl-entry\"\u003e\n\nHengl, T., Miller, M. A., Križan, J., Shepherd, K. D., Sila, A.,\nKilibarda, M., et al.others. (2021). African soil properties and\nnutrients mapped at 30 m spatial resolution using two-scale ensemble\nmachine learning. *Scientific Reports*, *11*(1), 1–18.\ndoi:[10.1038/s41598-021-85639-y](https://doi.org/10.1038/s41598-021-85639-y)\n\n\u003c/div\u003e\n\n\u003cdiv id=\"ref-hengl2018random\" class=\"csl-entry\"\u003e\n\nHengl, T., Nussbaum, M., Wright, M. N., Heuvelink, G. B., \u0026 Gräler, B.\n(2018). Random forest as a generic framework for predictive modeling of\nspatial and spatio-temporal variables. *PeerJ*, *6*, e5518.\ndoi:[10.7717/peerj.5518](https://doi.org/10.7717/peerj.5518)\n\n\u003c/div\u003e\n\n\u003cdiv id=\"ref-hijmans2020package\" class=\"csl-entry\"\u003e\n\nHijmans, R. J., Bivand, R., Forner, K., Ooms, J., \u0026 Pebesma, E. (2020).\n*\u003cspan class=\"nocase\"\u003eterra: Spatial Data Analysis\u003c/span\u003e*. CRAN.\nRetrieved from \u003chttps://rspatial.org/terra\u003e\n\n\u003c/div\u003e\n\n\u003cdiv id=\"ref-agronomy11040703\" class=\"csl-entry\"\u003e\n\nMøller, A. B., Mulder, V. L., Heuvelink, G. B. M., Jacobsen, N. M., \u0026\nGreve, M. H. (2021). Can we use machine learning for agricultural land\nsuitability assessment? *Agronomy*, *11*(4).\ndoi:[10.3390/agronomy11040703](https://doi.org/10.3390/agronomy11040703)\n\n\u003c/div\u003e\n\n\u003cdiv id=\"ref-roy2006plant\" class=\"csl-entry\"\u003e\n\nRoy, R. N., Finck, A., Blair, G. J., \u0026 Tandon, H. L. S. (2006). *\u003cspan\nclass=\"nocase\"\u003ePlant nutrition for food security: A guide for integrated\nnutrient management\u003c/span\u003e* (Vol. 16, p. 368). FAO.\n\n\u003c/div\u003e\n\n\u003cdiv id=\"ref-stumpf2017uncertainty\" class=\"csl-entry\"\u003e\n\nStumpf, F., Schmidt, K., Goebes, P., Behrens, T., Schönbrodt-Stitt, S.,\nWadoux, A., … Scholten, T. (2017). Uncertainty-guided sampling to\nimprove digital soil maps. *Catena*, *153*, 30–38.\ndoi:[10.1016/j.catena.2017.01.033](https://doi.org/10.1016/j.catena.2017.01.033)\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n","funding_links":[],"readme_doi_urls":["https://doi.org/10.1038/s41598-021-85639-y","https://dx.doi.org/10.1016/j.catena.2017.01.033","https://doi.org/10.1007/s10705-017-9870-x","https://doi.org/10.7717/peerj.5518","https://doi.org/10.3390/agronomy11040703","https://doi.org/10.1016/j.catena.2017.01.033"],"works":{},"citation_counts":{},"total_citations":0,"keywords_from_contributors":[],"project_url":"https://ost.ecosyste.ms/api/v1/projects/308138","html_url":"https://ost.ecosyste.ms/projects/308138"}