Title: | Spatial Data Processing for Decision Making |
---|---|
Description: | Methods for processing spatial data for decision-making. This package is an R implementation of methods provided by the open source software GeoFIS <https://www.geofis.org> (Leroux et al. 2018) <doi:10.3390/agriculture8060073>. The main functionalities are the management zone delineation (Pedroso et al. 2010) <doi:10.1016/j.compag.2009.10.007> and data aggregation (Mora-Herrera et al. 2020) <doi:10.1016/j.compag.2020.105624>. |
Authors: | Serge Guillaume [aut], Jean-Luc Lablée [aut, cre], INRAE [cph] (National Research Institute for Agriculture, Food and Environment, France) |
Maintainer: | Jean-Luc Lablée <[email protected]> |
License: | CeCILL |
Version: | 1.1.0 |
Built: | 2024-11-03 06:32:38 UTC |
Source: | CRAN |
The Fis aggregation operator to be used in Fusion
fis
FisPro::Fis object, The Fis to be used in the aggregation operator
output_index
integer value, The index (1-based index) of the output in the Fis to be used in the aggregation
Aggregation using linguistic rules
The functional aggregation operator to be used in Fusion
func
Function, The function used for the aggregation
The OWA aggregation operator to be used in Fusion
weights
numeric vector, The weights of the OWA aggregation operator (the sum of the weights must be equal to 1 without negative values)
Aggregation using numerical operators
The WAM aggregation operator to be used in Fusion
weights
numeric vector, The weights of the WAM aggregation operator (the sum of the weights must be equal to 1 without negative values)
Aggregation using numerical operators
The soil conductivity of a vine plot in year 2014
data(conductivity_2014)
data(conductivity_2014)
sp::SpatialPointsDataFrame object with 353 observations and 1 attribute:
conduct
numeric value, The soil conductivity
The soil conductivity border of a vine plot
data(conductivity_border)
data(conductivity_border)
sp::SpatialPolygonsDataFrame object with 1 polygon delimiting the border of the vine plot:
id
integer value, The id of the polygon
Classify data in management zones of maps obtained with the Zoning algorithms.
DataInZone(data, maps, use_id = FALSE)
DataInZone(data, maps, use_id = FALSE)
data |
sp::SpatialPointsDataFrame or sp::SpatialMultiPointsDataFrame object, The input data. |
maps |
sp::SpatialPolygonsDataFrame object, or a list of sp::SpatialPolygonsDataFrame, The map or list of maps to process. |
use_id |
boolean, Use the id attribute of the zone in the map if TRUE, or the order index (1-based indexed) of the zone in the map if FALSE (the default). |
sp::SpatialPointsDataFrame or sp::SpatialMultiPointsDataFrame object depending of the type of input data. Return table of membership of each point in the zones for each map, the input data and a column for each map processed (named "map{number of zones in the map}") with the class of each point.
Function to create an "Euclidean" distance
To be used with the Zoning combine_distance
or attribute_distance
field
EuclideanDistance()
EuclideanDistance()
Euclidean distance object
The main class to perform data fusion
More information is available in the vignette "Data Fusion with GeoFIS"
aggregate
data.tree::Node object, or a list of data.tree::Node, The node(s) to aggregate
new()
The constructor to build an object of class Fusion.
Fusion$new(source)
source
data.frame or sp::Spatial*DataFrame object of sp::sp package
Keep only numeric attributes
perform()
Perform the data fusion
Fusion$perform()
output()
Get the output aggregated data (same object type as data source)
Fusion$output()
data.frame or sp::Spatial*DataFrame object
Guillaume S, Bates T, Lablee J, Betts T, Taylor J (2020). “Combining Spatial Data Layers Using Fuzzy Inference Systems: Application to an Agronomic Case Study.” In Proceedings of the 6th International Conference on Geographical Information Systems Theory, Applications and Management (GISTAM 2020), 62-71. ISBN 978-989-758-425-1.
Mora-Herrera DY, Guillaume S, Snoeck D, Zuniga Escobar O (2020). “A fuzzy logic based soil chemical quality index for cacao.” Computers and Electronics in Agriculture, 177, 105624. doi:10.1016/j.compag.2020.105624.
# more information about this example in the vignette "Data Fusion with GeoFIS" # section "Learning illustration" library(GeoFIS) data(fusion_cars) fusion <- NewFusion(fusion_cars) a <- NewFusionInput("a", NewMfTrapezoidalInf(4, 20), "A") v <- NewFusionInput("v", NewMfTrapezoidalSup(100, 500), "V") s <- NewFusionInput("s", NewMfTrapezoidalSup(120, 220), "S") c <- NewFusionInput("c", NewMfTrapezoidalInf(6, 16), "C") owa_aggreg <- NewFusionAggreg("score", NewAggregOwa(c(1, 0, 0, 0)), a, v, s, c) fusion$aggregate <- owa_aggreg fusion$perform() score <- fusion$output()["score"] print(score)
# more information about this example in the vignette "Data Fusion with GeoFIS" # section "Learning illustration" library(GeoFIS) data(fusion_cars) fusion <- NewFusion(fusion_cars) a <- NewFusionInput("a", NewMfTrapezoidalInf(4, 20), "A") v <- NewFusionInput("v", NewMfTrapezoidalSup(100, 500), "V") s <- NewFusionInput("s", NewMfTrapezoidalSup(120, 220), "S") c <- NewFusionInput("c", NewMfTrapezoidalInf(6, 16), "C") owa_aggreg <- NewFusionAggreg("score", NewAggregOwa(c(1, 0, 0, 0)), a, v, s, c) fusion$aggregate <- owa_aggreg fusion$perform() score <- fusion$output()["score"] print(score)
Illustration dataset for data fusion numerical operators learning
data(fusion_cars)
data(fusion_cars)
data.frame object with four cars described by four attributes:
A
numeric value, the acceleration time (s) from 0 to 100 km/h
V
numeric value, the volume of the trunk (l)
S
numeric value, the maximum speed (km/h)
C
numeric value, the gas consumption (l per 100 km)
Defines the allowed labels for the FisPro::Mfs of the fuzzy inputs or output in the FisPro::Fis "Fusion"
get_labels()
Get the allowed labels depending on the granularity in the FisPro::Fis
for granularity 2, allowed labels are: [low, high]
for granularity 3, allowed labels are: [low, average, high]
for granularity 4, allowed labels are: [very_low, low, high, very_high]
for granularity 5, allowed labels are: [very_low, low, average, high, very_high]
FusionLabel$get_labels(granularity)
granularity
integer value, The granularity of the fuzzy inputs or output in the FisPro::Fis (value in range [2, 5])
character vector, The allowed labels for the granularity
Function to create a "Fuzzy" distance
The fuzzy distance function is based on a fuzzy partition that allows for integrating expert knowledge into distance calculations
To be used with the Zoning attribute_distance
field
FuzzyDistance(fisin)
FuzzyDistance(fisin)
fisin |
FisPro::FisIn object, The partition used for the fuzzy distance (must be a standardized fuzzy partition) |
Fuzzy distance object
Guillaume S, Charnomordic B, Loisel P (2013). “Fuzzy partitions: a way to integrate expert knowledge into distance calculations.” International Journal of Information Sciences, 245, 76-95. doi:10.1016/j.ins.2012.07.045.
Guillaume S, Charnomordic B (2013). “Fuzzy partition-based distance practical use and implementation.” In CFP12FUZ-USB ICN (ed.), IEEE International Conference on Fuzzy Systems, paper F-1136.
Learn the OWA weights using a non-negative least-square optimization method with the constraint that the sum of weights must be equal to 1. The input values are previously sorted in increasing order. The resulting weights are given from min to max. More information is available in the vignette "Data Fusion with GeoFIS", section "Learning illustration".
LearnOwaWeights(data, target, digits = 3)
LearnOwaWeights(data, target, digits = 3)
data |
data.frame or numeric matrix, The input data (all columns must be in range [0, 1]) |
target |
numeric vector, The target data (must be in range [0, 1]) |
digits |
integer value, The number of digits to which weights are to be rounded (default is 3) |
numeric vector, The OWA weights
Learn the WAM weights using a non-negative least-square optimization method with the constraint that the sum of weights must be equal to 1.
More information is available in the vignette "Data Fusion with GeoFIS", section "Learning illustration".
LearnWamWeights(data, target, digits = 3)
LearnWamWeights(data, target, digits = 3)
data |
data.frame or numeric matrix, The input data (all columns must be in range [0, 1]) |
target |
numeric vector, The target data (must be in range [0, 1]) |
digits |
integer value, The number of digits to which weights are to be rounded (default is 3) |
numeric vector, The WAM weights
Function to create a "Maximum" distance
To be used with the Zoning zone_distance
field
MaximumDistance()
MaximumDistance()
Maximum distance object
Function to create a "Mean" distance
To be used with the Zoning zone_distance
field
MeanDistance()
MeanDistance()
Mean distance object
Function to create a "Minimum" distance
To be used with the Zoning zone_distance
field
MinimumDistance()
MinimumDistance()
Minimum distance object
Function to create a "Minkowski" distance
To be used with the Zoning combine_distance
field
MinkowskiDistance(power = 2)
MinkowskiDistance(power = 2)
power |
numeric value, The power of the Minkowski distance |
Minkowski distance object
Function to create an aggregation operator of class AggregFis to be used in Fusion
NewAggregFis(fis, output_index = 1)
NewAggregFis(fis, output_index = 1)
fis |
FisPro::Fis object, The Fis to be used in the aggregation operator |
output_index |
integer value, The index (1-based index) of the output in the Fis to be used in the aggregation (the default is 1) |
AggregFis object
Aggregation using linguistic rules
Function to create an aggregation operator of class AggregFunction to be used in Fusion
NewAggregFunction(func)
NewAggregFunction(func)
func |
The function to be used for the aggregation |
Function to create an aggregation operator of class AggregOwa to be used in Fusion
NewAggregOwa(weights)
NewAggregOwa(weights)
weights |
numeric vector, The weights of the OWA aggregation operator (the sum of the weights must be equal to 1 without negative values) |
Aggregation using numerical operators
Function to create an aggregation operator of class AggregWam to be used in Fusion
NewAggregWam(weights)
NewAggregWam(weights)
weights |
numeric vector, The weights of the WAM aggregation operator (the sum of the weights must be equal to 1 without negative values) |
Aggregation using numerical operators
Function to create object of class FisPro::Fis to be used in AggregFis
NewFisFusion( fis_name, input_names, input_granularities, output_name, output_conclusions )
NewFisFusion( fis_name, input_names, input_granularities, output_name, output_conclusions )
fis_name |
character vector, The name of the Fis |
input_names |
character vector, The Fis inputs names |
input_granularities |
integer vector, The granularity (number of membership functions) for each Fis input (granularity must be in range [2, 5]) |
output_name |
character vector, The name of the Fis output |
output_conclusions |
numeric or character vector, The conclusions of the rules in the Fis |
FisPro::Fis object
Aggregation using linguistic rules
Function to create object of class Fusion
NewFusion(...)
NewFusion(...)
... |
arguments of Fusion constructor |
Fusion object
Function to create an aggregation node to be used in Fusion
NewFusionAggreg(name, aggreg, ...)
NewFusionAggreg(name, aggreg, ...)
name |
character vector, The name of the node |
aggreg |
Aggreg object, The aggregation operator to be used to compute the aggregation of satisfaction degrees |
... |
data.tree::Node objects, The nodes to aggregate |
data.tree::Node object
Function to create an input node to be used in Fusion
NewFusionInput(name, mf, attribute = name)
NewFusionInput(name, mf, attribute = name)
name |
character vector, The name of the node |
mf |
FisPro::Mf object, The membership function to be used to compute the satisfaction degree of the input |
attribute |
character vector, The attribute name in the source dataset (default is the same as name) |
data.tree::Node object
From raw data to satisfaction degrees
Function to create object of class Zoning
NewZoning(...)
NewZoning(...)
... |
arguments of Zoning constructor |
Zoning object
Soil experimental data in three municipalities of Tolima department in Colombia (Mora-Herrera et al. 2020)
data(tolima)
data(tolima)
data.frame object with 30 observations and 8 attributes:
Cadmium
numeric value, Cadmium in Soil (ppm)
pH
numeric value, pH Soil (°pH)
OM
numeric value, Organic Matter (%)
P
numeric value, Available Phosphorus (ppm)
K
numeric value, Exchangeable Potassium (meq/100 g)
BalanceGap
numeric value, Balance Gap (%)
Ngap_N_OpN
numeric value, N Gap (N/Ntarget)
Base_S
numeric value, Base Saturation (%)
Mora-Herrera DY, Guillaume S, Snoeck D, Zúñiga Escobar O (2020). “A fuzzy logic based soil chemical quality index for cacao.” Computers and Electronics in Agriculture, 177, 105624. doi:10.1016/j.compag.2020.105624.
Function to create an "Area" smallest zone
To be used with the Zoning smallest_zone
field
ZoneArea(area)
ZoneArea(area)
area |
numeric value, The minimum area of the zone to retain the zone in the Zoning process |
Area Smallest zone object
Function to create a "Size" smallest zone
To be used with the Zoning smallest_zone
field
ZoneSize(number_of_points)
ZoneSize(number_of_points)
number_of_points |
integer value, The minimum number of points in the zone to retain the zone in the Zoning process |
Size Smallest zone object
The main class to perform zoning
A complete use-case example is described in the vignette "Zoning with GeoFIS"
border
sp::SpatialPolygons object, The border used to limit the processed area, or NULL
if the Convex Hull of data source is used
Only data points within the border polygon are processed
The default value is NULL
neighborhood
numeric value, The minimum edge length shared by two Voronoi polygons for being considered as neighbors
or NULL
if all contiguous Voronoi polygons are considered as neighbors
The default value is NULL
attribute_distance
list of Distance object (write-only), The functions used to compute the distance between two data points in the attribute space
The length of the list must be equal to the number of zonable attributes, the distance objects are treated in the order of zonable attributes
In case of a single attribute into the zonable dataset, the list is optional and a single Distance object can be provided
Allowed distance objects: EuclideanDistance, FuzzyDistance or NULL
if the attribute should not be used in the zoning process
The default value is a list of EuclideanDistance
See Zoning documentation main parameters univariate distance
combine_distance
Distance object (write-only), The function used to combine attribute distances in case of multivariate zoning
Allowed distance objects: EuclideanDistance or MinkowskiDistance
The default value is EuclideanDistance
See Zoning documentation main parameters multivariate combination
zone_distance
Distance object (write-only), The function used to compute the distance between 2 zones
Allowed distance objects: MaximumDistance, MinimumDistance or MeanDistance
The default value is MaximumDistance
The pair of zones to be merged are those for which the zone_distance
is minimum.
See Zoning documentation main parameters between zone distance
smallest_zone
Smallest zone object (write-only), This criterion is used to determine the smallest size for a zone (number of points or area) to be kept in the final map
Allowed Smallest zone objects: ZoneSize or ZoneArea
The default value is ZoneSize with 1 point
new()
Constructor, create a new instance of Zoning
Zoning$new(source, warn = TRUE)
source
sp::SpatialPointsDataFrame or sp::SpatialMultiPointsDataFrame object, The data source
warn
logical value, Show warnings if TRUE, default value is TRUE
zonable_data()
Get the zonable data
Keep only the attributes that can be used in the zoning process, meaning numeric atributes, without missing values and with a range that is not limited to a unique value
The last condition is required by the min-max standardization process
Zoning$zonable_data()
sp::SpatialPointsDataFrame object
perform_voronoi()
Compute the Voronoi diagram
Zoning$perform_voronoi()
voronoi_map()
Get the Voronoi map
Zoning$voronoi_map()
sp::SpatialPolygons object
perform_neighborhood()
Identify adjacent polygons in the voronoi tesselation
Zoning$perform_neighborhood()
neighborhood_map()
Get the neighborhood map
Zoning$neighborhood_map()
sp::SpatialLinesDataFrame object
perform_zoning()
Perform the zoning
Zoning$perform_zoning()
map_size()
Get the number of maps with different number of zones available after perform zoning
Zoning$map_size()
integer value
map()
Get the map corresponding to a number of zones
Zoning$map(number_of_zones)
number_of_zones
integer value, The number of zones in the map
sp::SpatialPolygonsDataFrame object
maps()
Get the maps corresponding to a number of zones
Zoning$maps(number_of_zones)
number_of_zones
integer vector, The number of zones in each map
list of sp::SpatialPolygonsDataFrame object
Pedroso M, Taylor J, Tisseyre B, Charnomordic B, Guillaume S (2010). “A segmentation algorithm for the delineation of management zones.” Computer and Electronics in Agriculture, 70(1), 199-208. doi:10.1016/j.compag.2009.10.007.
Guillaume S, Charnomordic B, Loisel P (2013). “Fuzzy partitions: a way to integrate expert knowledge into distance calculations.” International Journal of Information Sciences, 245, 76-95. doi:10.1016/j.ins.2012.07.045.
Guillaume S, Charnomordic B (2013). “Fuzzy partition-based distance practical use and implementation.” In CFP12FUZ-USB ICN (ed.), IEEE International Conference on Fuzzy Systems, paper F-1136.