From 98637b1209d9ec2150fa7e2d26cbcf18c2e7b909 Mon Sep 17 00:00:00 2001 From: MGousseff Date: Wed, 18 Oct 2023 17:40:44 +0200 Subject: [PATCH] Examples corrected in inportLCZraster Typos corrected in paper.md Some typos corrected in the vignettes Several references added to paper.md --- .../CODE_OF_CONDUCT.md => CODE_OF_CONDUCT.md | 0 .github/CONTRIBUTING.md => CONTRIBUTING.md | 0 R/importLCZraster.R | 14 +- docs/articles/joss/paper.bib | 93 ++-- docs/articles/joss/paper.md | 439 +++++++++--------- man/importLCZraster.Rd | 4 +- vignettes/lczexplore_alter.Rmd | 2 +- vignettes/lczexplore_en.Rmd | 30 +- vignettes/lczexplore_raster_vector.Rmd | 16 +- 9 files changed, 324 insertions(+), 274 deletions(-) rename .github/CODE_OF_CONDUCT.md => CODE_OF_CONDUCT.md (100%) rename .github/CONTRIBUTING.md => CONTRIBUTING.md (100%) diff --git a/.github/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md similarity index 100% rename from .github/CODE_OF_CONDUCT.md rename to CODE_OF_CONDUCT.md diff --git a/.github/CONTRIBUTING.md b/CONTRIBUTING.md similarity index 100% rename from .github/CONTRIBUTING.md rename to CONTRIBUTING.md diff --git a/R/importLCZraster.R b/R/importLCZraster.R index 3ff74f4..0bb3bf2 100644 --- a/R/importLCZraster.R +++ b/R/importLCZraster.R @@ -20,11 +20,21 @@ #' #' @examples #' redonBbox<-importLCZvect(dirPath=paste0(system.file("extdata", package = "lczexplore"), -#' "/bdtopo_2_2/Redon"), file="rsu_lcz.geojson",column="LCZ_PRIMARY", output="bBox") +#' "/bdtopo_2_2/Redon"), file="rsu_lcz.geojson", column="LCZ_PRIMARY", output="bBox") #' #' redonWudapt<-importLCZraster(system.file("extdata", package = "lczexplore"), #' fileName="redonWudapt.tif",bBox=redonBbox) #' +#' # another way to get the bounding box when one explores a given city would be the use of the +#' # getbb() function from the osmdata package. +#' # This exaample requires the osmdata package and therefore is not executed here +#' # redonBbox<-osmdata::getbb("Redon") +#' # redonWudapt<-importLCZraster(system.file("extdata", package = "lczexplore"), +#' # fileName="redonWudapt.tif",bBox=redonBbox) +#' +#' # another way to get the bounding box when one doesn't want to compare to a vector map is to enter it's coordinates +#' # and feed them to st_bbox() of the sf package. +#' #' # the following example can only be executed when user has downloaded #' # CONUS-wide LCZ map and Training Areas on WUDAPT website #' # sanDiegobBoxCoord<-st_sf(a=1:2, geom=st_sfc( @@ -37,7 +47,7 @@ #' #fileName="CONUS_LCZ_map_NLCD_v1.0_epsg4326.tif", #' #column="CONUS_LCZ_map_NLCD_v1.0_epsg4326" #' # ,bBox=sanDiegoBbox) -#' #showLCZ(sanDiegoWudapt,column="CONUS_LCZ_map_NLCD_v1.0_epsg4326") +#' #showLCZ(sanDiegoWudapt, column="CONUS_LCZ_map_NLCD_v1.0_epsg4326") importLCZraster<-function(dirPath,zone="europe",bBox,fileName="EU_LCZ_map.tif", column='EU_LCZ_map', typeLevels=c("1"="1","2"="2","3"="3","4"="4","5"="5","6"="6","7"="7","8"="8", "9"="9","10"="10","101"="11","102"="12","103"="13","104"="14", diff --git a/docs/articles/joss/paper.bib b/docs/articles/joss/paper.bib index a8f08a7..3d680f3 100644 --- a/docs/articles/joss/paper.bib +++ b/docs/articles/joss/paper.bib @@ -154,36 +154,36 @@ @article{chingWUDAPTUrbanWeather2018a issn = {0003-0007, 1520-0477}, doi = {10.1175/BAMS-D-16-0236.1}, urldate = {2023-06-30}, - } - - @article{cohenCoefficientAgreementNominal1960, - title = {A {{Coefficient}} of {{Agreement}} for {{Nominal Scales}}}, - author = {Cohen, Jacob}, - year = {1960}, - month = apr, - journal = {Educational and Psychological Measurement}, - volume = {20}, - number = {1}, - pages = {37--46}, - issn = {0013-1644, 1552-3888}, - doi = {10.1177/001316446002000104}, - urldate = {2023-06-30}, - langid = {english} - } - - @article{demuzereLCZGeneratorWeb2021, - title = {{{LCZ Generator}}: {{A Web Application}} to {{Create Local Climate Zone Maps}}}, - shorttitle = {{{LCZ Generator}}}, - author = {Demuzere, Matthias and Kittner, Jonas and Bechtel, Benjamin}, - year = {2021}, - month = apr, - journal = {Frontiers in Environmental Science}, - volume = {9}, - pages = {637455}, - issn = {2296-665X}, - doi = {10.3389/fenvs.2021.637455}, - urldate = {2023-06-30}, - } +} + +@article{cohenCoefficientAgreementNominal1960, + title = {A {{Coefficient}} of {{Agreement}} for {{Nominal Scales}}}, + author = {Cohen, Jacob}, + year = {1960}, + month = apr, + journal = {Educational and Psychological Measurement}, + volume = {20}, + number = {1}, + pages = {37--46}, + issn = {0013-1644, 1552-3888}, + doi = {10.1177/001316446002000104}, + urldate = {2023-06-30}, + langid = {english} +} + +@article{demuzereLCZGeneratorWeb2021, + title = {{{LCZ Generator}}: {{A Web Application}} to {{Create Local Climate Zone Maps}}}, + shorttitle = {{{LCZ Generator}}}, + author = {Demuzere, Matthias and Kittner, Jonas and Bechtel, Benjamin}, + year = {2021}, + month = apr, + journal = {Frontiers in Environmental Science}, + volume = {9}, + pages = {637455}, + issn = {2296-665X}, + doi = {10.3389/fenvs.2021.637455}, + urldate = {2023-06-30}, +} @techreport{bernardGenericAlgorithmAutomatically2023, type = {Preprint}, @@ -235,4 +235,37 @@ @article{RJ-2018-009 pages = {439--446}, volume = {10}, number = {1} +} + + +@article{demuzere2019mapping, + title={Mapping Europe into local climate zones}, + author={Demuzere, Matthias and Bechtel, Benjamin and Middel, Ariane and Mills, Gerald}, + journal={PloS one}, + volume={14}, + number={4}, + pages={e0214474}, + year={2019}, + publisher={Public Library of Science San Francisco, CA USA} +} + +@article{demuzere2022global, + title={A global map of Local Climate Zones to support earth system modelling and urban scale environmental science}, + author={Demuzere, Matthias and Kittner, Jonas and Martilli, Alberto and Mills, Gerald and Moede, Christian and Stewart, Iain D and van Vliet, Jasper and Bechtel, Benjamin}, + journal={Earth System Science Data Discussions}, + volume={2022}, + pages={1--57}, + year={2022}, + publisher={G{\"o}ttingen, Germany} +} + +@article{demuzere2020combining, + title={Combining expert and crowd-sourced training data to map urban form and functions for the continental US}, + author={Demuzere, Matthias and Hankey, Steve and Mills, Gerald and Zhang, Wenwen and Lu, Tianjun and Bechtel, Benjamin}, + journal={Scientific data}, + volume={7}, + number={1}, + pages={264}, + year={2020}, + publisher={Nature Publishing Group UK London} } \ No newline at end of file diff --git a/docs/articles/joss/paper.md b/docs/articles/joss/paper.md index a994b7d..982d00d 100644 --- a/docs/articles/joss/paper.md +++ b/docs/articles/joss/paper.md @@ -1,59 +1,61 @@ --- -title: 'lczexplore : an R package to explore Local Climate Zone classifications' +title: 'lczexplore: an R package to explore Local Climate Zone classifications' tags: -- R SOFTWARE -- climate -- environment -- GIS -- spatial analysis -- cities - + - R SOFTWARE + - climate + - environment + - GIS + - spatial analysis + - cities + authors: - -- name: Matthieu Gousseff - orcid: 0000-0002-7106-2677 - equal-contrib: true - affiliation: 1 -- name: Erwan Bocher - orcid : 0000-0002-4936-7079 - equal-contrib: true - affiliation: 1 -- name: Jérémy Bernard - orcid : 0000-0001-7374-5722 - corresponding: true # (This is how to denote the corresponding author) - affiliation: "1, 2, 4" -- name: Elisabeth Le Saux Wiederhold - orcid: - corresponding: true - affiliation: 3 + + - name: Matthieu Gousseff + orcid: 0000-0002-7106-2677 + equal-contrib: true + affiliation: 1 + - name: Erwan Bocher + orcid: 0000-0002-4936-7079 + equal-contrib: true + affiliation: 1 + - name: Jérémy Bernard + orcid: 0000-0001-7374-5722 + corresponding: true # (This is how to denote the corresponding author) + affiliation: "1, 2, 4" + - name: Elisabeth Le Saux Wiederhold + orcid: + corresponding: true + affiliation: 3 affiliations: - -- name: CNRS, Lab-STICC, UMR 6285, Vannes, France - index: 1 -- name: University of Savoie Mont-Blanc, LOCIE, UMR 5271, France - index: 2 -- name: Université Bretagne Sud, Lab-STICC, UMR 6285, Vannes, France - index: 3 -- name : University of Gothenburg, Department of Earth Sciences, Sweden - index: 4 + + - name: CNRS, Lab-STICC, UMR 6285, Vannes, France + index: 1 + - name: University of Savoie Mont-Blanc, LOCIE, UMR 5271, France + index: 2 + - name: Université Bretagne Sud, Lab-STICC, UMR 6285, Vannes, France + index: 3 + - name: University of Gothenburg, Department of Earth Sciences, Sweden + index: 4 bibliography: paper.bib date: 01 april 2023 -editor_options: - markdown: +editor_options: + markdown: wrap: sentence --- # Summary -Climate change is a growing concern for city planners as Urban Heat Islands have an impact on mortality [@clarke1972some], -health in general [@lowe2016energy] and consumption of energy for building cooling [@malys2012microclimate] among other effects. -A first step towards large scale study of urban climate is to define classes based on logical division of the landscape, +Climate change is a growing concern for city planners as Urban Heat Islands have an impact on +mortality [@clarke1972some], health in general [@lowe2016energy] and consumption of energy +for building cooling [@malys2012microclimate] among other effects. +A first step towards large scale study of urban climate is to define classes +based on logical division of the landscape, such as Local Climate Zones (LCZ) defined by [@stewart2012local]. -The lczexplore package aims at comparing different LCZ classifications, +The lczexplore package aims at comparing different LCZ classifications, but can be used to compare any pair of classifications on geographical units. -A spatial comparison is performed by producing agreement maps between classifications, agreement statistics and +A spatial comparison is performed by producing agreement maps between classifications, agreement statistics and a confusion matrix to help qualify and quantify the misclassifications. This software is available as a free and opensource R package. @@ -61,95 +63,100 @@ This software is available as a free and opensource R package. # Statement of need ## Comparing maps -As stated in [@visser2006map] comparing map is an important issue in environmental research. -The four main reasons to compare categorical variables on geographical units are: -- to assess the differences between maps generated by models under different scenarios and assumptions, -- to detect temporal changes, -- to calibrate or validate models, -- to perform uncertainty and sensitivity analysis. +As stated in [@visser2006map] comparing maps is an important issue in environmental research. +The four main reasons to compare categorical variables on geographical units are: +- to assess the differences between maps generated by models under different scenarios and assumptions, +- to detect temporal changes, +- to calibrate or validate models, +- to perform uncertainty and sensitivity analysis. -## Comparing specifically LCZ maps +## Comparing specifically LCZ maps Climate change is a growing concern for city planners with a special focus on Urban Heat Island phenomenons. -The terms *rural* and *urban* lack of a clear definition and different classifications +The terms *rural* and *urban* lack of a clear definition and different classifications of urban and rural landscapes were proposed. Stewart and Oke [@stewart2012local] defined an approach that complies with [@grigg1965logic] criteria of geographical classification. -Their Local Climate Zones (LCZ) are based on a logical segmentation of land-use and urban canopy parameters +Their Local Climate Zones (LCZ) are based on a logical segmentation of land-use and urban canopy parameters and define 10 urban types and 7 land cover types. -LCZ have gained popularity in the past decade as they sum up relevant information and can help, for instance, +LCZ have gained popularity in the past decade as they sum up relevant information and can help, for instance, apprehend the intensity of the Urban Heat Island [@kotharkar2018evaluating]. Several methods aim to classify a territory into LCZ, but only few workflows allow an automatic classification for any given area. -[@quan2021systematic] distinguishes two main streams of production of these LCZ: -- the raster stream processes remotely sensed information, and applies machine learning -algorithms trained using local experts' knowledge. For instance, the WUDAPT platform produced -LCZ maps of Europe and North-America this way [@chingWUDAPTUrbanWeather2018a]. -- the vector stream uses Geographic Information System (GIS) layers that represent the main topographic features, -defines spatial units, computes urban canopy parameters and uses them to classify spatial units into LCZ. -For instance, the GeoClimate geospatial toolbox produces LCZ classifications -from OpenStreetMap or french BDTopo data [@bocher2021geoclimate]. +[@quan2021systematic] distinguishes two main streams of production of these LCZ: +- the raster stream processes remotely sensed information, and applies machine learning + algorithms trained using local experts' knowledge. In this way, the WUDAPT community [@chingWUDAPTUrbanWeather2018a] + produced thousands of city-based LCZ maps (accessible via the LCZ Generator ([@demuzereLCZGeneratorWeb2021])) + but also large-scale maps for Europe, the continental United States and the whole world ([@demuzere2019mapping], + [@demuzere2020combining], [@demuzere2022global]). +- the vector stream uses Geographic Information System (GIS) layers that represent the main topographic features, + defines spatial units, computes urban canopy parameters and uses them to classify spatial units into LCZ. + For instance, the GeoClimate geospatial toolbox produces LCZ classifications + from OpenStreetMap or french BDTopo data [@bocher2021geoclimate]. The existence of several methods to produce LCZ classifications, or the use of a method with different input data, raises the need for a tool to quickly get: 1. Statistics measuring the general agreement between two classifications -2. A spatial representation to allow a fast visual assessment of the zones -where the classifications agree or disagree. -3. A confusion matrix, to explore how the levels of one classification break up -in levels of the other classification, shown in a graphical way to help visualize the -main differences between the classifications. +2. A spatial representation to allow a fast visual assessment of the zones + where the classifications agree or disagree. +3. A confusion matrix, to explore how the levels of one classification break up + in levels of the other classification, shown in a graphical way to help visualize the + main differences between the classifications. # State of the field and feature comparison ## State of the field on spatial classification comparison -The question of going beyond the simple visual observation of differences between maps is not a new one. -A first approach would be, on raster maps, to simply compute the agreement between two maps as the proportion -of pixels for which the two maps have the same value of the variable of interest. +The question of going beyond the simple visual observation of differences between maps is not a new one. +A first approach would be, on raster maps, to simply compute the agreement between two maps as the proportion +of pixels for which the two maps have the same value of the variable of interest. This approach is often sufficient to help specialists compare pairs of -maps, but it has two main drawbacks +maps, but it has two main drawbacks: - - two totally random maps won't have a value of agreement of zero, as some pixel values may agree by chance, - - only raster maps where pixels match perfectly (same size, not translated) can be treated, or -some pre-treatment are needed (like nearest neighbour interpolation for instance). +- two totally random maps won't have a value of agreement of zero, as some pixel values may agree by chance, +- only raster maps where pixels match perfectly (same size, not translated) can be treated, or + some pre-treatment are needed (like nearest neighbour interpolation for instance). -To prevent the first drawback, [@monserudComparingGlobalVegetation1992] +To prevent the first drawback, [@monserudComparingGlobalVegetation1992] proposed the use of Cohen's kappa coefficient of agreement for nominal scales [@cohenCoefficientAgreementNominal1960]. -Each pixel is seen as an individual to which each map assigns a value of a categorical variable -(each map is seen as a "rater"). +Cohen's Kappa allow to assess how two raters agree or differ in the task of rating individual. +In our case, each pixel is seen as an individual, each map is seen as a rater and the value of the raster at each pixel +is seen as the rate. -The comprehensive Map Comparison kit, which was released in 2001 by the -Netherlands Environmental Assessment Agency [@visser2006map], is an example of tool -that allows multiple methods to compare raster maps. It includes a fuzzy algorithm which allows to tackle small -shifts of one map from another. It only works on raster maps, only on Windows OS and -doesn't allow automation for several pairs of maps. +The comprehensive Map Comparison kit, which was released in 2001 by the +Netherlands Environmental Assessment Agency [@visser2006map], is an example of a tool +that provides multiple methods to compare raster maps. It includes a fuzzy algorithm which allows to tackle small +shifts of one map from another. It only works on raster maps, only on Windows OS and +doesn't allow automation for several pairs of maps. -To tackle the second drawback, one can rasterize vector files, for instance by applying a raster grid -to a vector layer and assign, for instance, the value whose area is the most present in the pixel. -This can produce severe effect of smoothing one may want to prevent. +To tackle the second drawback, one can rasterize vector files, for instance by applying a regular grid +to a vector layer and assign to each pixel the value of the vector geometry most present in the pixel +(in terms of area of the intersection). +This can produce severe effect of smoothing one may want to prevent. -Other approaches also rely on comparing the distribution of some variables of interest. -For instance [@hammerbergImplicationsEmployingDetailed2018], rather than comparing the maps, -compares some model output variables using the data of the map. +Other approaches also rely on comparing the distribution of some variables of interest. +For instance [@hammerbergImplicationsEmployingDetailed2018], rather than comparing the maps, +compare some model output variables using the data of the map. -## State of the field on Local Climate Zone maps comparison. +## State of the field on Local Climate Zone maps comparison. -As Local Climate Zones emerged as a new standard for characterizing urban landscapes [@demuzereLCZGeneratorWeb2021], -specific tools are needed to allow easy automation of LCZ maps. As a matter of fact, "ground truth" is hard to -define in matters of LCZs, and one may want to compare LCZs produced by experts and by different algorithms. +As Local Climate Zones emerged as a new standard for characterizing urban landscapes [@demuzereLCZGeneratorWeb2021], +specific tools are needed to allow easy automation of LCZ maps. As a matter of fact, "ground truth" is hard to +define in matters of LCZs, and one may want to compare LCZs produced by experts and by different algorithms. The very definition of LCZs by [@stewart2012local] relies on ranges of values for several indicators, and sometimes -several LCZ types could be assigned to the corresponding geometries. Therefore, one may associate a confidence -value to the LCZ type and check if filtering pixels (for raster data) or geometries (for vector data) -accordingly to a confidence threshold has an impact on the way maps agree or disagree. +several LCZ types could be assigned to the corresponding geometries. Therefore, one may associate a confidence +value to the LCZ type and check if filtering pixels (for raster data) or geometries (for vector data) +accordingly to a confidence threshold has an impact on the way maps agree or disagree. A comparison of a raster stream result and a GIS vector stream approach was proposed by [@muhammad2022inference]. -This comparison relies on rasterising vector data. It uses several tools: QGIS, python scripts and SAGA GIS. As far as we know, -the scripts and the automation of the method are not publicly available. +This comparison relies on rasterising vector data. It uses several tools: QGIS, python scripts and SAGA GIS. +As far as we know, the scripts and the automation of the method are not publicly available. -The need for automation of vector comparison, and specific features (like standard colors or legends +The need for automation of map comparison (both raster and vector), +and specific features (like standard colors or legends for LCZs and sensitivity analaysis) justified the development of `lczexplore`. ## Features @@ -157,28 +164,28 @@ for LCZs and sensitivity analaysis) justified the development of `lczexplore`. ### General workflow and processing steps The `lczexplore` package is a set of `R` functions to import, visualize, group and compare LCZ classifications, -even when they don't use the same spatial units to classify the area. -These LCZ classifications can come from vector layers or raster layers (the latter will be vectorized -by the dedicated import function) +even when they don't use the same spatial units to classify the area. +These LCZ classifications can come from vector layers or raster layers (the latter will be vectorized +by the dedicated import function) ![Workflow and main functions of the package\label{fig:Workflow and main functions of the package}](workflow.png){width="100%"} Figure 1 describes the general workflow of the package. -Main functions are presented in plain lines, the dashed boxes and arrows represent optional steps. -These functions are presented in detail in the next section, and they allow the following steps of exploration. +Main functions are presented in plain lines, the dashed boxes and arrows represent optional steps. +These functions are presented in detail in the next section, and they allow the following steps of exploration: -1. The LCZ classifications (or any other qualitative variables) are imported -from a file (geojson or shapefile format) +1. The LCZ classifications (or any other qualitative variables) are imported + from a file (geojson or shapefile format) 2. Each LCZ classification can then be visualized 3. Some LCZ levels may be grouped in broader categories -4. A pair of LCZ classifications (or qualitative variable maps) can then be compared : +4. A pair of LCZ classifications (or qualitative variable maps) can then be compared: - a map of agreement/disagreement is produced, - - the general agreement and a pseudo-kappa indicator of agreement are computed, + - the general agreement and a pseudo-kappa indicator of agreement are computed, - the summed surface of each LCZ type is computed for each classification, - a confusion matrix shows how the levels of one LCZ classification break up into the levels of the other -5. Influence of the level of confidence on the agreement between classifications is performed -(sensitivity analysis) +5. Influence of the level of confidence on the agreement between classifications is performed + (sensitivity analysis) All the steps of the analysis can be easily automated in R, for instance on several cities at a time. @@ -190,106 +197,106 @@ The main functions are presented in this section. More details about their argum The `importLCZvect` function allows to import a LCZ classification from a geojson or a shapefile. Geometries and LCZ types are needed, but one can also optionally load unique identifiers -and a confidence level for the LCZ type of each geometry. - -The `importLCZraster` function allows the import from a raster map, and the user has to feed it a geotiff +and a confidence level for the LCZ type of each geometry. + +The `importLCZraster` function allows the import from a raster map, and the user has to feed it a geotiff and a bounding box of the area of interest. -The import functions output objects of class `simple feature`, as defined by the -openGIS consortium and as handled by the `sf` package, an R reference library for +The import functions output objects of class `simple feature`, as defined by the +openGIS consortium and as handled by the `sf` package, an R reference library for Geographical Information System Vector Data [@RJ-2018-009]. - -The `compareLCZ` function creates intersected geometries on which classifications -either totally agree or totally disagree, as seen in the figure 2, -and this prevents artificial rounding effects -that may arise with a rasterisation approach. + +The `compareLCZ` function creates intersected geometries on which classifications +either totally agree or totally disagree, as seen in the figure 2, +and this prevents artificial rounding effects +that may arise with a rasterisation approach. ![Intersecting geometries to have full agreement or disagreement \label{fig:Agreement independent of the shape of the geoms}](intersecDemo.png){width="100%"} Next, the function computes: -- the area of each LCZ type for each classification, -- the percentage of area on which the two classifications agree, and a map of this agreement, +- the area of each LCZ type for each classification, +- the percentage of area on which the two classifications agree, and a map of this agreement, - a pseudo kappa statistics which evaluates agreement beyond how two random maps may agree, - a confusion matrix of how the types of one LCZ classification break up in the types of the other, -and a graphic of this, with an indicator of the summed area for each LCZ type (useful -if the two classifications disagree on a type almost absent of the area). + and a graphic of this, with an indicator of the summed area for each LCZ type (useful + if the two classifications disagree on a type almost absent of the area). The output of these functions are shown in the minimal example section. -With the `standard` representation, comparing LCZ is made easy by a default setting of legends and colors. +With the `standard` representation, comparing LCZ maps is made easy by a default setting of legends and colors. The `alter` representation allows the user to deal with regrouped LCZ categories or any type of qualitative variables. -Levels can either be specified by the user or deduced from the data, -colors can either be defined by the user or chosen from a random palette. +Levels can either be specified by the user or deduced from the data, +colors can either be defined by the user or chosen from a random palette. -### Class levels grouping +### Class levels grouping It is sometimes useful to group some LCZ types, for instance to create a broader category for -all the urban LCZ types and another for landcape LCZ types, +all the urban LCZ types and another for landcape LCZ types, or to group the levels with similar estimated impact on an urban heat island intensity. -The `groupLCZ` function allows the user to specify the LCZ types one wants to group together, +The `groupLCZ` function allows the user to specify the LCZ types one wants to group together, the names of the new resulting categories and their corresponding colors. -One can then feed `compareLCZ` function these new groups, setting `repr="alter"`, and specify desired levels and colors. +One can then feed `compareLCZ` function these new groups, setting `repr="alter"`, and specify desired levels and colors. ![Grouping of LCZ types into larger categories \label{fig: Grouping of LCZ types into larger categories}](fromBrutToGrouped.png) ### Import and explore categorical variable (other than LCZ classifications) -The workflow of comparison of LCZ maps can be used for any pair of maps of categorical variables, -under certain limitations : -- there must not be more than 36 levels for the categorical variable to explore +The workflow of comparison of LCZ maps can be used for any pair of maps of categorical variables, +under certain limitations: +- there must not be more than 36 levels for the categorical variable to explore - the associated geometries must be (multi) polygons or easily converted to them - (typically, the package would not be suitable to compare road characterization), -- the geometries must be topographically valid (this is also true for LCZ). + (typically, the package would not be suitable to compare road characterization), +- the geometries must be topographically valid (this is also true for LCZ). The `importQualVar` function allows the import of such variables on (multi-) polygons maps. -It outputs an sf object that can be fed to the other main functions +It outputs an sf object that can be fed to the other main functions of the package (`showLCZ`, `compareLCZ`, `groupLCZ`...). ### Sensitivity analysis -The Geoclimate algorithm adds a uniqueness value to the LCZ type it assigns to a spatial unit. -It measures if another LCZ levels could have been assigned to this unit. Thus, it can be seen +The Geoclimate algorithm adds a uniqueness value to the LCZ type it assigns to a spatial unit. +It measures if another LCZ levels could have been assigned to this unit. Thus, it can be seen as a confidence value of the LCZ type. -The `lczexplore ` package allows a sensitivity analysis according to this level of confidence, -in order to answer the question : -**does keeping only geometries with a higher confidence value -make the degree of agreement between two classifications higher?** +The `lczexplore ` package allows a sensitivity analysis according to this level of confidence, +in order to answer the question: +**does keeping only geometries with a higher confidence value +make the degree of agreement between two classifications higher?** This sensitivity analysis is performed considering all LCZ types and within each individual LCZ type. ![Sensitivity analysis according to confidence for all LCZ levels \label{fig: Sensitivity analysis according to confidence}](confidSensibGen.png) -The agreement between classifications for the geometries with a confidence level higher than the threshold, +The agreement between classifications for the geometries with a confidence level higher than the threshold, and their numbers, are plotted in blue. The agreement and the numbers of geometries under the threshold are plotted in magenta. -On this example, -one can see that ditching geometries that have a confidence level lower than 0.5 leads to an increase of the agreement -up to more than 90%. The curve then tends to flatten, and the number of kept geometries decreases a lot (from 602 to 122). -One also needs to notice that on this example, most geometries didn't have a confidence value +On this example, +one can see that ditching geometries that have a confidence level lower than 0.5 increases the agreement +to more than 90%. The curve then tends to flatten, and the number of kept geometries decreases a lot (from 602 to 122). +One also needs to notice that on this example, most geometries didn't have a confidence value (7476 with a general agreement of 59.21%) # Coding implementation `lczexplore` is an R package, all its specific functions are coded in R language. -It relies on state-of-the art packages : -- geographical computation requires the **`sf`** package for vector data and the **`terra`** package for raster data, -- data management mainly requires the following packages : **`dplyr, tidyr, forcats, rlang`** -and **`methods`** packages, -- graphical production uses **`ggplot2, grDevices, cowplot`** and **`RColorBrewer`**, -- tests need the **`tinytest`** package. +It relies on state-of-the art packages: +- geographical computation requires the **`sf`** package for vector data and the **`terra`** package for raster data, +- data management mainly requires the following packages: **`dplyr, tidyr, forcats, rlang`** + and **`methods`** packages, +- graphical production uses **`ggplot2, grDevices, cowplot`** and **`RColorBrewer`**, +- tests need the **`tinytest`** package. -Every step corresponds to an R function (see the workflow on figure 1 for the name of the main functions). +Every step corresponds to an R function (see the workflow on figure 1 for the name of the main functions). -Every function has an associated file for unitary testing. +Every function has an associated file for unitary testing. # A minimal example ## Install and load -The lczexplore package can be downloaded from `https://github.com/orbisgis/lczexplore` and installed with +The lczexplore package can be downloaded from `https://github.com/orbisgis/lczexplore` and installed with the command `install_github`: ``` r @@ -298,8 +305,8 @@ devtools::install_github("orbisgis/lczexplore", build_vignettes = TRUE) library(lczexplore) ``` -In order to discover the package, vignettes can be browsed via `browseVignettes("lczexplore")` -or by calling them directly : +In order to discover the package, vignettes can be browsed via `browseVignettes("lczexplore")` +or by calling them directly: ```r vignette("lczexplore_en") @@ -310,8 +317,8 @@ vignette("lczexplore_alter") ## Import the data -This example uses two LCZ classifications of French Redon city, -produced using a single LCZ classification method (the GeoClimate workflow), +This example uses two LCZ classifications of French Redon city, +produced using a single LCZ classification method (the GeoClimate workflow), with two different input data: OpenStreetMap and the 2.2 version of the French BDTopo. @@ -340,7 +347,7 @@ redonBDT<-importLCZvect( ## Visualize the data -To visualize a LCZ classification, use the `showLCZ` function. Setting `repr` to `"standard"` directly +To visualize a LCZ classification, use the `showLCZ` function. Setting `repr` to `"standard"` directly deals with standard values of LCZ levels and colors. ```r @@ -354,24 +361,24 @@ showLCZ( ``` -The result is a map of the Local Climate Zones on the area : +The result is a map of the Local Climate Zones on the area: ![Local Climate Zones for Redon city based on the GeoClimate workflow applied to OSM data \label{fig:LCZ on Redon spatial units}](showRedonOSM.png){width="100%"} ## Compare the two LCZ classifications -To compare the two loaded LCZ classifications, use the `compareLCZ` function. +To compare the two loaded LCZ classifications, use the `compareLCZ` function. -- the `sf1` and `column1` arguments allow to specify the sf dataset of the first map, and the column in which -the LCZ levels are stored (same for `sf2` and `column2`), -- the `wf1` and `wf2` arguments take strings to specify the workflows used to produce the input data. +- the `sf1` and `column1` arguments allow to specify the sf dataset of the first map, and the column in which + the LCZ levels are stored (same for `sf2` and `column2`), +- the `wf1` and `wf2` arguments take strings to specify the workflows used to produce the input data. - The `location` argument allows to name the area of interest covered by input datasets. The 3 previous -arguments will be parsed in -the legends of the graphics (except if `title` is specified) and the name of potential csv output files, -- when `exWrite=TRUE`, the data computed to create the confusion matrix will be written -in a csv file in the working directory, + arguments will be parsed in + the legends of the graphics (except if `title` is specified) and the name of potential csv output files, +- when `exWrite=TRUE`, the data computed to create the confusion matrix will be written + in a csv file in the working directory, - if `saveG=TRUE`, the four plots created by the function will be written in a png file in the working directory. - + ```r # Compare how the BDTopo and the OpenStreetMap Data produce different classifications. # The outputs are stored in a list. @@ -388,47 +395,47 @@ All graphics are concatenated for a quick glance. The first and second maps show the spatial distribution of the first and second LCZ classifications levels, respectively. The third map shows where the two classifications agree or disagree. -The last graphic is a confusion matrix: how the LCZ types of the first classification break-up in those -of the second, in percentage of the surface. +The last graphic is a confusion matrix: how the LCZ types of the first classification break-up in those +of the second, in percentage of the surface. `CompareLCZ ` outputs a list called `matConfOut` which contains: -- `$data`, intersected geometries, their identifiers and associated confidence value -(if fed to the fonction), their LCZ type and their area, -- `$areas`, the summed area for each LCZ for both classifications, -- `$matConfLarge`, the confusion matrix, +- `$data`, intersected geometries, their identifiers and associated confidence value + (if fed to the fonction), their LCZ type and their area, +- `$areas`, the summed area for each LCZ for both classifications, +- `$matConfLarge`, the confusion matrix, - `$percAgg`, the general agreement of the two classification on the whole area -(as a percentage of the global surface of the area), -- `$pseudoK`, the value of a heuristic pseudo Cohen's Kappa coefficient of agreement. - -The value `pseudoK` corresponds to a Kappa, -where the cells of the cross tabulation would be -weighted by the percentage of the concerned surface. - -One can see in a quick glance, that the BDTopo workflow leads to more and smaller Spatial Reference Units (1553 RSU) -than the OpenStreetMap workflow (521 RSU). The third map shows that while the classifications tend to -agree on wide vegetation areas, there seem to be more some discrepancies in the urban areas. -The last graphics helps to refine this analysis: one can notice that -both workflows quite agree for "compact mid" and "low plants" LCZ levels (89% and 88 % of the concerned areas). -On the contrary, only 48% of the areas set to "dense trees" by BDTopo workflow are also set to + (as a percentage of the global surface of the area), +- `$pseudoK`, the value of a heuristic pseudo Cohen's Kappa coefficient of agreement. + +The value `pseudoK` corresponds to a Kappa, +where the cells of the cross tabulation would be +weighted by the percentage of the concerned surface. + +One can see in a quick glance, that the BDTopo workflow leads to more and smaller Spatial Reference Units (1553 RSU) +than the OpenStreetMap workflow (521 RSU). The third map shows that while the classifications tend to +agree on wide vegetation areas, there seem to be more some discrepancies in the urban areas. +The last graphics helps to refine this analysis: one can notice that +both workflows quite agree for "compact mid" and "low plants" LCZ levels (89% and 88 % of the concerned areas). +On the contrary, only 48% of the areas set to "dense trees" by BDTopo workflow are also set to "dense trees" by OpenStreetMap workflow, while 37% of these areas are set as "low plants." -In the same way, 73% of the areas set to "compact low" by +In the same way, 73% of the areas set to "compact low" by BDTopo workflow are set to "compact mid" by OpenStreetMap workflow. This is coherent with the fact that building heights are often missing on OpenStreetMap and that the algorithm that GeoClimate uses to predict them is less precise than -the available information of BDTopo. One may read more in [@bernardGenericAlgorithmAutomatically2023] - about differences between these workflows. +the available information of BDTopo. One may read more in [@bernardGenericAlgorithmAutomatically2023] +about differences between these workflows. ## Study the impact of confidence on agreement The `confidSensib` function makes a sensitivity analysis of the agreement according to the threshold of confidence above which one keeps the geometries of the compared maps. -To perform this analysis, the confidence value and the identifier of each geometry must be fed to the comparison -function. The `$data` slot is then passed to `confidSensib`. -The `saveG` allows to set the path to a folder where resulting graphics will be saved. +To perform this analysis, the confidence value and the identifier of each geometry must be fed to the comparison +function. The `$data` slot is then passed to `confidSensib`. +The `saveG` allows to set the path to a folder where resulting graphics will be saved. -The values of confidence for which the agreement will be computed are determined by the range of +The values of confidence for which the agreement will be computed are determined by the range of confidence values present in the data and by the number of points, set by the `nPoints` argument. @@ -461,28 +468,28 @@ sensitAnalysis<-confidSensib(inputDf=comparison$data, filePath="", Figure 7 shows the resulting graphics for the agreement per LCZ type (types not present in the dataset are excluded). -![Sensitivity analysis according to confidence by LCZ levels ](confidSensibByLCZ.png) +![Sensitivity analysis according to confidence by LCZ levels ](confidSensibByLCZ.png) For each LCZ type, the x-axis shows the minimum confidence threshold. The y-axis shows the agreement levels. -Each cyan point shows the average agreement between classifications for spatial units where -the minimum confidence value is greater than the x-axis value. +Each cyan point shows the average agreement between classifications for spatial units where +the minimum confidence value is greater than the x-axis value. -As one wants to be sure the dropped units +As one wants to be sure the dropped units didn't have a greater agreement, they are showed as magenta triangles. -For this particular example, it seems that for the "Open Low" LCZ type, +For this particular example, it seems that for the "Open Low" LCZ type, the greater the confidence, the smaller the agreement! -This unexpected result is explained by the fact that in our case, the confidence qualifies the method, not the data. +This unexpected result is explained by the fact that in our case, the confidence qualifies the method, not the data. In this example, in the OSM dataset which is compared, -the building height are mostly estimated using a statistical method [@bernardEstimationMissingBuilding2022] as stated above. +the building height are mostly estimated using a statistical method [@bernardEstimationMissingBuilding2022] as stated above. ## Group some levels and perform the same analysis -The `groupLCZ` function aggregates chosen levels into broader categories. For each category, a vector is needed, -which name is the name of the broader category to create and which values -are the levels to be grouped in this new category. +The `groupLCZ` function aggregates chosen levels into broader categories. For each category, a vector is needed, +which name is the name of the broader category to create and which values +are the levels to be grouped in this new category. ```r redonOSMgrouped<-groupLCZ(redonOSM,column="LCZ_PRIMARY", @@ -505,11 +512,11 @@ redonBDTgrouped<-groupLCZ(redonBDT,column="LCZ_PRIMARY", ``` -By default, the column where the new categories are stored is named `"grouped"`, +By default, the column where the new categories are stored is named `"grouped"`, but it can be set with the argument `outCol`. It is the possible to perform the same analysis as on standard LCZ classifications, -as shown in the following example : +as shown in the following example: ```r showLCZ(redonOSMgrouped, column="grouped",repr="alter", @@ -525,16 +532,16 @@ compareLCZ(sf1=redonOSMgrouped, column1="grouped", wf1="OpenStreetMap data", ![Map of grouped levels on the city of Redon \label{fig: Grouped LCZ on the city of Redon}](redonGrouped.png) -You can also map any qualitative variable using this grouped representation, +You can also map any qualitative variable using this grouped representation, as long as you specify the expected levels the same way. ## An example of qualitative variables -The function `importQualVar` allows you to import maps of qualitative variables on (multi)polygons. -For instance, classifications of urban tissue called +The function `importQualVar` allows you to import maps of qualitative variables on (multi)polygons. +For instance, classifications of urban tissue called Urban Typolgy by Random Forest [@bocherGeoprocessingFrameworkCompute2018] are available as examples in this package. -After the import, the usual functions can be used, as shown in the following code : +After the import, the usual functions can be used, as shown in the following code: ```r utrfRedonBDT<-importQualVar(dirPath=paste0( @@ -544,11 +551,11 @@ utrfRedonBDT<-importQualVar(dirPath=paste0( showLCZ(sf=utrfRedonBDT, column="TYPO_MAJ",repr="alter", title = " UTRF classification of the French city of Redon") ``` -![An example of some qualitative variable : Urban Typology by Random Forest (UTRF)](importQualVarUTRF.png) +![An example of some qualitative variable: Urban Typology by Random Forest (UTRF)](importQualVarUTRF.png) -Figure 9 represents the UTRF classification of the French city of Redon, +Figure 9 represents the UTRF classification of the French city of Redon, as computed by the GeoClimate workflow on BDTopo v2.2 data. The colors were not specified and therefoer were -randomly picked from a palette. +randomly picked from a palette. ```r utrfRedonOSM<- @@ -577,7 +584,7 @@ Guidelines. # Research projects involving lczexplore -The lczexplore package was developed thanks to the project PÆNDORA2 -(Pour la gestion du confort estival : Données, Outils et Recherche-Action) (2022 -2025), funded by ADEME. +The lczexplore package was developed thanks to the project PÆNDORA2 +(Pour la gestion du confort estival: Données, Outils et Recherche-Action) (2022 -2025), funded by ADEME. -# References +# References \ No newline at end of file diff --git a/man/importLCZraster.Rd b/man/importLCZraster.Rd index d089dcf..abd3c35 100644 --- a/man/importLCZraster.Rd +++ b/man/importLCZraster.Rd @@ -45,7 +45,7 @@ A future version may include the world data once a strategy is defined to deal w } \examples{ redonBbox<-importLCZvect(dirPath=paste0(system.file("extdata", package = "lczexplore"), -"/bdtopo_2_2/Redon"), file="rsu_lcz.geojson",column="LCZ_PRIMARY", output="bBox") +"/bdtopo_2_2/Redon"), file="rsu_lcz.geojson", column="LCZ_PRIMARY", output="bBox") redonWudapt<-importLCZraster(system.file("extdata", package = "lczexplore"), fileName="redonWudapt.tif",bBox=redonBbox) @@ -62,5 +62,5 @@ fileName="redonWudapt.tif",bBox=redonBbox) #fileName="CONUS_LCZ_map_NLCD_v1.0_epsg4326.tif", #column="CONUS_LCZ_map_NLCD_v1.0_epsg4326" # ,bBox=sanDiegoBbox) -#showLCZ(sanDiegoWudapt,column="CONUS_LCZ_map_NLCD_v1.0_epsg4326") +#showLCZ(sanDiegoWudapt, column="CONUS_LCZ_map_NLCD_v1.0_epsg4326") } diff --git a/vignettes/lczexplore_alter.Rmd b/vignettes/lczexplore_alter.Rmd index 1dff9eb..1bfd1f9 100644 --- a/vignettes/lczexplore_alter.Rmd +++ b/vignettes/lczexplore_alter.Rmd @@ -31,7 +31,7 @@ The purpose of this package is to easily compare different local climate zone (L on the same study territory. For these LCZ, the `repr="standard"` representation sets proper levels and colors by default. You can read the `lczexplore_english` vignette for an overview. -This vignette deals with other cases, when `repr="alter"`, that is : +This vignette deals with other cases, when `repr="alter"`, that is: - when one groups LCZ levels into broader categories, - when LCZ levels are expressed in an unexpected format, - or even compares maps of other qualitative variables. diff --git a/vignettes/lczexplore_en.Rmd b/vignettes/lczexplore_en.Rmd index a0d16a6..7b27130 100644 --- a/vignettes/lczexplore_en.Rmd +++ b/vignettes/lczexplore_en.Rmd @@ -24,7 +24,7 @@ if (!require("png")) { ``` -# A package to explore Local Climate Zones : lczexplore +# A package to explore Local Climate Zones: lczexplore ## Purpose and origin The lczexplore package was developed thanks to the PAENDORA2 (Pour la gestion du confort estival : Données, Outils et Recherche-Action, 2022 -2025, funded by ADEME, a French agency for ecological transition). @@ -42,18 +42,18 @@ It has been extended to compare any pair of qualitative variable set on valid ge ## Installation -The following allows the installation from the github repository : (`devtools::install_github("orbisgis/lczexplore", build_vignettes = TRUE)`). +The following allows the installation from the github repository: (`devtools::install_github("orbisgis/lczexplore", build_vignettes = TRUE)`). On can also install from the tar.gz file and install it (see `?install.packages`). -Load the package : `library(lczexplore)`. +Load the package: `library(lczexplore)`. ```{r} library(lczexplore) ``` -# First use-case : load a file with geometries and standard LCZ +# First use-case: load a file with geometries and standard LCZ ## Import files with importLCZvect function @@ -111,7 +111,7 @@ showLCZ(sf=redonOSM,wf="OSM",column="LCZ_PRIMARY",repr="standard",drop=TRUE) ``` ### Alternative visualization -The non-standard representation, triggered with `repr=alter` is useful when : +The non-standard representation, triggered with `repr=alter` is useful when: - one wants to **regroup** some LCZ types into more general categories, - the LCZ **don't have a standard encoding** - one want's to use **custom colors** @@ -121,7 +121,7 @@ With `repr=alter`, one passes the vector of possible levels to the argument `LCZ If no vector of levels or no vector of colors is given, the levels will be deduced from the unique values present in the data, and the colors will be picked from the "Polychrome 36" palette of the `grDevices` package. -For instance : one can first plot the column without knowing the LCZ levels present. +For instance: one can first plot the column without knowing the LCZ levels present. ```{r, fig.dim = c(8, 6)} # Choice of random colors from a palette testCol <- palette.colors(n=17, palette="Polychrome 36") @@ -166,10 +166,10 @@ showLCZ(redonOSMgrouped, column="grouped",repr="alter",wf="OSM", # Compare two LCZ classification with the function compareLCZ **The purpose of this package is to easily compare local climate zone classifications produced by different algorithms on the same study area.** -In our example, the GeoClimate workflow was used with two different input data to produce two LCZ classifications : +In our example, the GeoClimate workflow was used with two different input data to produce two LCZ classifications: the BD TOPO® v2.2, produced by the French National Institute of Geographic and Forest Information, and OpenStreetMap. -NOTE : The vignette "lczexplore_raster_vector" explores in detail another example with WUDAPT raster data. +NOTE: The vignette "lczexplore_raster_vector" explores in detail another example with WUDAPT raster data. One has to call `compareLCZ` and feed it, for each dataset, @@ -180,12 +180,12 @@ you need to tell which dataset is the reference - A map of each LCZ classification is plotted. - The function then intersects the geometries of both sf objects in order to get geometries where the **two classification either totally agree either totally disagree.** This agreement is plotted on a third graphics. -- At last, a confusion matrix (or agreement matrix) is computed : +- At last, a confusion matrix (or agreement matrix) is computed: the area of each intersected geometry and the values of the two LCZ classifications are used to show how one type of the first classification breaks up into the levels of the second classification. - The matrix is shown in the fourth and last graphics. -NOTE : if the two data sets to compare have the same column names, +NOTE: if the two data sets to compare have the same column names, the compareLCZ function will concatenate a ".1" string to the column names of the second file *The graphical output includes 4 graphs and is easier to read after zooming or exporting.* @@ -239,7 +239,7 @@ comparisonGrouped<-compareLCZ(sf1=redonBDT,column1="LCZ_PRIMARY", wf1="groupedBD ## Output data for further analysis -`CompareLCZ `outputs a list called `matConfOut` which contains : +`CompareLCZ `outputs a list called `matConfOut` which contains: - `$data` the intersected geometries, their identifiers (if `geomID` was not empty), their LCZ types and their areas, - `$matConfLarge` the confusion matrix, @@ -247,7 +247,7 @@ comparisonGrouped<-compareLCZ(sf1=redonBDT,column1="LCZ_PRIMARY", wf1="groupedBD - `$areas` the summed area for each LCZ of both classifications. -At last : it `exWrite=TRUE` the data are exported to a .csv file whose name +At last: it `exWrite=TRUE` the data are exported to a .csv file whose name is created from the argument `wf1` and `wf2`. It can then be loaded for further analysis. ```{r} @@ -266,7 +266,7 @@ GeoClimate supplies a **uniqueness value**, between 0 and 1. The closer it is to LCZ type was a good candidate. So this uniqueness can be seen as a confidence value. -## Import the necessary data : LCZ type, but also confidence. +## Import the necessary data: LCZ type, but also confidence. When using the `importLCZvect` function one needs to specify the confidence value associated to the LCZ (`confid` argument). On can also set the name of the geometry identifier (`geomID` argument ). @@ -288,11 +288,11 @@ redonCompare<-compareLCZ(sf1=redonBDT,wf1="bdt", geomID1 = "ID_RSU",column1 ="LC The function `confidSensib` performs the sensitivity analysis from the output of `compareLCZ`. -NOTE : if the two data sets to compare have the same column names, +NOTE: if the two data sets to compare have the same column names, the compareLCZ function will concatenate a ".1" string to the column names of the second file, so the enriched names will be the ones to feed `confidSensib`. -The question we want to answer is : **Does the agreement between the two classification gets bigger if we keep only the geometries for which the LCZ value is associated to a confidence value bigger than a thershold?** +The question we want to answer is: **Does the agreement between the two classification gets bigger if we keep only the geometries for which the LCZ value is associated to a confidence value bigger than a thershold?** The span of the confidence values is divided on as many points as the user chooses with the argument `nPoints` diff --git a/vignettes/lczexplore_raster_vector.Rmd b/vignettes/lczexplore_raster_vector.Rmd index 68c4cca..29c8495 100644 --- a/vignettes/lczexplore_raster_vector.Rmd +++ b/vignettes/lczexplore_raster_vector.Rmd @@ -23,23 +23,23 @@ if (!require("png")) { ``` -To install and discover the package, please read the lczexplore_english vignette. To load it simply type : +To install and discover the package, please read the lczexplore_english vignette. To load it simply type: ```{r} library(lczexplore) ``` -Usecase : comparing the LCZ available on the WUDAPT european LCZ map and the Geoclimate approach using OpenStreetMap input data +Usecase: comparing the LCZ available on the WUDAPT european LCZ map and the Geoclimate approach using OpenStreetMap input data This vignette illustrates the use of the package to compare maps produced with different approaches, it does not aim at drawing conclusion on the relevance of these methods, nor does it aim at describing them in details. # Import and visualize a raster map of LCZ -## Data : the Redon territory from the european LCZ map produced by the WUDAPT project +## Data: the Redon territory from the european LCZ map produced by the WUDAPT project The World Urban Database and Access Portal Tools is a project which aims at creating LCZ with earth observation data. -The details of the project and the related papers can be found on the website of the project : https://www.wudapt.org/ +The details of the project and the related papers can be found on the website of the project: https://www.wudapt.org/ -The map we are going to use in this vignette is the European LCZ map, as described in the paper available at the following url : +The map we are going to use in this vignette is the European LCZ map, as described in the paper available at the following url: https://doi.org/10.1371/journal.pone.0214474 As this method is one of the most used we included the map tif in the embedded data of the package. @@ -56,7 +56,7 @@ redonBbox<-importLCZvect(dirPath=paste0(system.file("extdata", package = "lczexp ``` The second step is to import the raster map and use the previous bounding box to crop the territory of interest. -The importLCZraster function performs this in a simple call : +The importLCZraster function performs this in a simple call: ```{r} redonWudapt<-importLCZraster(system.file("extdata", package = "lczexplore"), fileName="redonWudapt.tif",bBox=redonBbox) @@ -77,7 +77,7 @@ One can then use standard R functions to explore the data. summary(redonWudapt) summary(redonWudapt$EU_LCZ_map) ``` -One can see, for instance that no pixel of the imported territory set to one of the following levels : 1, 2, 4, 5, 7, 10, 103 or 105, +One can see, for instance that no pixel of the imported territory set to one of the following levels: 1, 2, 4, 5, 7, 10, 103 or 105, or that the most present LCZ type is 104, with 1116 pixels. @@ -98,7 +98,7 @@ The following code shows an example of color choice. # Import and visualize a vector layer map of LCZ -## Data : LCZ on the Redon territory produced by the GeoClimate workflow using OpenStreetMap as input. +## Data: LCZ on the Redon territory produced by the GeoClimate workflow using OpenStreetMap as input. These data are embedded in `lczexplore`. On can import them using the `importLCZvect` function. This function allows to load geojson or shp files, and one must specify the name of the column containing the LCZ types.