Skip to content

Commit

Permalink
Examples corrected in inportLCZraster
Browse files Browse the repository at this point in the history
Typos corrected in paper.md
Several references added to paper.md
  • Loading branch information
MGousseff committed Oct 18, 2023
1 parent 5931713 commit 87f79de
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 26 deletions.
5 changes: 2 additions & 3 deletions R/importLCZraster.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#'
#' redonWudapt<-importLCZraster(system.file("extdata", package = "lczexplore"),
#' fileName="redonWudapt.tif",bBox=redonBbox)
#'
#' showLCZ(redonWudapt, column="EU_LCZ_map")
#' # 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(
Expand All @@ -35,8 +35,7 @@
#' #sanDiegoWudapt<-importLCZraster(
#' #dirPath="path_of_the_tiff",
#' #fileName="CONUS_LCZ_map_NLCD_v1.0_epsg4326.tif",
#' #column="CONUS_LCZ_map_NLCD_v1.0_epsg4326"
#' # ,bBox=sanDiegoBbox)
#' #,bBox=sanDiegoBbox)
#' #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",
Expand Down
33 changes: 33 additions & 0 deletions docs/articles/joss/paper.bib
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
53 changes: 30 additions & 23 deletions docs/articles/joss/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ editor_options:

# 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,
Expand All @@ -61,7 +63,7 @@ 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.
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,
Expand All @@ -84,8 +86,10 @@ 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].
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
Expand All @@ -109,30 +113,32 @@ The question of going beyond the simple visual observation of differences betwee
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).

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
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.
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.
compare some model output variables using the data of the map.

## State of the field on Local Climate Zone maps comparison.

Expand All @@ -146,10 +152,11 @@ value to the LCZ type and check if filtering pixels (for raster data) or geometr
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
Expand All @@ -166,13 +173,13 @@ by the dedicated import function)
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.
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)
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 summed surface of each LCZ type is computed for each classification,
Expand Down Expand Up @@ -217,7 +224,7 @@ 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.
Expand Down Expand Up @@ -254,7 +261,7 @@ The Geoclimate algorithm adds a uniqueness value to the LCZ type it assigns to a
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 :
in order to answer the question:
**does keeping only geometries with a higher confidence value
make the degree of agreement between two classifications higher?**

Expand All @@ -266,8 +273,8 @@ The agreement between classifications for the geometries with a confidence level
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 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%)

Expand Down

0 comments on commit 87f79de

Please sign in to comment.