analyse intersections of spatial DB
Purpose of the functionality
When analyzing spatial DB with eaip DB, it is performed, for the moment: a test if geometries from the spatial DB intersects eaip DB (with sf::st_intersects
). It should be useful to add also the proportion of area inside eaip DB for each geometry. For this part, some preliminary tests have shown that it is quicker with sf
than with terra
.
The results from the analysis should be added to normalized variables:
- eaip (TRUE/FALSE) for intersects
- eaip_prop (double between 0 and 1) for intersection
It is surely better to use a generic function that will be used in a less generic one for eaip
Functions to be added
-
analyse_intersection return the result from intersect or intersection in a convenient way. - expected inputs
- x: sf object to be analysed
- y: sf object to do the analysis (typically eaip)
- analysis: character to precise the analysis to perform (intersect / proportion)
- verbose: to send message
- expected outputs
- data.frame of result, same rows as in x, with 1 or 2 columns ("intersect", "proportion")
- expected inputs
-
analyse_eaip wrapper of analyse_intersection to have the normalized names for return. - expected inputs
- x: sf object to be analysed
- y: eaip object
- analysis: character to precise the analysis to perform (intersect / proportion)
- verbose: to send message
- expected outputs
- data.frame of result, same rows as in x, with 1 or 2 columns ("eaip", "eaip_prop")
- expected inputs
Data to be added
- non
Documentation
-
analyse_intersection -
analyse_eaip
Test to be performed
-
analyse_intersection with ad hoc data