From 6d4181d97d91f016df827f5c66a546477adef9d9 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. Community Impact: A violation through a single incident or series of actions. Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. Community Impact: A serious violation of community standards, including sustained inappropriate behavior. Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. Consequence: A permanent ban from any sort of public interaction within the community. Copyright (c) 2024 fistools authors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. Devisscher S, Pallemaerts L, Delva S, Cartuyvels E (2024).
fistools: Tools & data used for wildlife management & invasive species in Flanders.
-R package version 0.2.0.
+R package version 1.0.0.
Repo containing widely used data & functions of the FIS team A list of functions & datasets can be found in the reference manual A list of functions & datasets can be found in the reference page Extracts a coordinate reference system (CRS) from a library of commonly used CRS codes
+This also fixes issues with the belge lambert 72 we use.
+The EPSG code is 31370, but the proj4string is not the same as the one in the EPSG database. A CRS object Applies Applies This function calculates the centroid of a polygon and returns the latitude, longitude and uncertainty of the centroid. A data frame with the unique identifier, latitude, longitude and uncertainty of the centroidContributor Covenant Code of Conduct
Our Pledge
EnforcementEnforcement Guidelines
1. Correction
+1. Correction
2. Warning
+2. Warning
3. Temporary Ban
+3. Temporary Ban
4. Permanent Ban
+4. Permanent Ban
MIT License
Citation
@Manual{,
title = {fistools: Tools & data used for wildlife management & invasive species in Flanders},
author = {Sander Devisscher and Lynn Pallemaerts and Soria Delva and Emma Cartuyvels},
year = {2024},
- note = {R package version 0.2.0},
+ note = {R package version 1.0.0},
}
diff --git a/docs/index.html b/docs/index.html
index 24f076d..c5cafca 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -33,7 +33,7 @@
@@ -57,8 +57,7 @@
installatie
what can I do with this package?
-Dev status
CRS_extracter
+
+ CRS_extracter.Rd
CRS_extracter(CRS, EPSG = TRUE)
Arguments
+
+
+Value
+ Examples
+ if (FALSE) { # \dontrun{
+# Example of how to use the CRS_extracter function
+crs_wgs <- CRS_extracter("WGS", EPSG = FALSE)
+crs_bel <- CRS_extracter("BEL72", EPSG = FALSE)
+
+epsg_wgs <- CRS_extracter("WGS", EPSG = TRUE)
+
+# Example of how to use the CRS_extracter function in combination with the sf & leaflet packages
+library(sf)
+library(tidyverse)
+library(leaflet)
+boswachterijen_df <- boswachterijen$boswachterijen_2024 %>%
+ st_transform(crs_bel) %>%
+ mutate(centroid = st_centroid(geometry)) %>%
+ st_drop_geometry() %>%
+ st_as_sf(sf_column_name = "centroid",
+ crs = crs_bel) %>%
+ st_transform(crs_wgs)
+
+leaflet() %>%
+ addTiles() %>%
+ addPolylines(data = boswachterijen$boswachterijen_2024) %>%
+ addCircles(data = boswachterijen_df, color = "red", radius = 1000)
+} # }
+
+
apply grtsdb
grtsdb::extract_sample
from inbo/GRTSdb to a custom perimeter. This function installs
+ grtsdb::extract_sample
from inbo/GRTSdb to a custom perimeter. This function installs
GRTSdb if it is missing from your machine.Author
Examples
if (FALSE) { # \dontrun{
# Preparation
-perimeter <- sf::st_as_sf(boswachterijen$boswachterijen_2024) %>%
+perimeter <- sf::st_as_sf(boswachterijen$boswachterijen_2024) %>%
dplyr::filter(Regio == "Taxandria",
Naam == "vacant 4")
@@ -97,12 +97,12 @@
Examples
n = 20,
export_path = ".")
-leaflet::leaflet() %>%
- leaflet::addTiles() %>%
+leaflet::leaflet() %>%
+ leaflet::addTiles() %>%
leaflet::addCircles(data = sample$samples,
- color = "red") %>%
+ color = "red") %>%
leaflet::addPolylines(data = sample$grid,
- color = "blue") %>%
+ color = "blue") %>%
leaflet::addPolylines(data = perimeter,
color = "black")
# Reuse a old sample
@@ -114,12 +114,12 @@ Examples
export_path = ".",
seed = seed)
- leaflet::leaflet() %>%
- leaflet::addTiles() %>%
+ leaflet::leaflet() %>%
+ leaflet::addTiles() %>%
leaflet::addCircles(data = sample$samples,
- color = "red") %>%
+ color = "red") %>%
leaflet::addPolylines(data = sample$grid,
- color = "blue") %>%
+ color = "blue") %>%
leaflet::addPolylines(data = perimeter,
color = "black")
} # }
diff --git a/docs/reference/boswachterijen.html b/docs/reference/boswachterijen.html
index 83b74f9..6fd4d50 100644
--- a/docs/reference/boswachterijen.html
+++ b/docs/reference/boswachterijen.html
@@ -18,7 +18,7 @@
Calculate the centroid of a polygon
+
+ calculate_polygon_centroid.Rd
calculate_polygon_centroid(sf_df, id)
Arguments
+
+
+Value
+ Examples
+ if (FALSE) { # \dontrun{
+# Example of how to use the calculate_polygon_centroid function
+# Load the necessary data
+boswachterijen <- boswachterijen$boswachterijen_2024
+
+# add a unique identifier to the sf object
+boswachterijen <- boswachterijen %>%
+dplyr::mutate(UUID = as.character(row_number()))
+
+# Calculate the centroid of the polygons
+centroids_data_final <- calculate_polygon_centroid(sf_df = boswachterijen, id = "UUID")
+
+# Plot the polygons and the centroids
+library(leaflet)
+
+# Sample 1 polygon and 1 centroid to plot using id
+sample_id <- sample(centroids_data_final$UUID, 1)
+
+leaflet() %>%
+ addProviderTiles("CartoDB.Positron") %>%
+ addPolygons(data = boswachterijen %>% dplyr::filter(UUID == sample_id),
+ weight = 1, color = "black", fillOpacity = 0.5) %>%
+ addCircles(data = centroids_data_final %>% dplyr::filter(UUID == sample_id),
+ lat = ~centroidLatitude, lng = ~centroidLongitude, radius = 5,
+ color = "black") %>%
+ addCircles(data = centroids_data_final %>% dplyr::filter(UUID == sample_id),
+ lat = ~centroidLatitude, lng = ~centroidLongitude, radius = ~centroidUncertainty,
+ color = "red", weight = 1)
+} # }
+
+
Examples
if (FALSE) { # \dontrun{
# extract the bounding box (WGS84) for the Project
-proj_sf <- st_sfc(st_polygon(list(drg_example$spatial$coordinates[1,,])), crs = 4326)
-proj_bbox <- st_bbox(proj_sf)
+proj_sf <- st_sfc(st_polygon(list(drg_example$spatial$coordinates[1,,])), crs = 4326)
+proj_bbox <- st_bbox(proj_sf)
class(proj_bbox)
# extract selected OSM features
osm <- collect_osm_features(proj_bbox)
@@ -128,15 +128,15 @@
Examples
line_elements = "road")
# calculate the area of each landuse class within the bbox
-landuse <- osm_polygons$osm_polygons %>%
- st_make_valid() %>%
- mutate(area = set_units(st_area(.), "km^2")) %>%
- group_by(landuse) %>%
+landuse <- osm_polygons$osm_polygons %>%
+ st_make_valid() %>%
+ mutate(area = set_units(st_area(.), "km^2")) %>%
+ group_by(landuse) %>%
summarise(area = sum(area))
# plot
## polygons
-(p1 <- ggplot(osm_polygons$osm_polygons %>% filter(!is.na(landuse)) %>% arrange(landuse)) +
+(p1 <- ggplot(osm_polygons$osm_polygons %>% filter(!is.na(landuse)) %>% arrange(landuse)) +
geom_sf(aes(fill = landuse), col = NA) +
scale_fill_manual(values = unique(arrange(osm$osm_polygons, landuse)$osm_fill)) +
theme_void() + theme(legend.position = "right"))
diff --git a/docs/reference/download_dep_media.html b/docs/reference/download_dep_media.html
index 097b395..e1de111 100644
--- a/docs/reference/download_dep_media.html
+++ b/docs/reference/download_dep_media.html
@@ -18,7 +18,7 @@
All functions
CRS_extracter
UUID list generator
apply grtsdb
boswachterijen
Boswachterijen
Calculate the centroid of a polygon
drg_example
drg_example
install sp
label converter
UUID list generator
Lib CRS
a charcter string specifiying the output style. Can be "eloket" or "labo". Default is "eloket".
a character string specifying the output style. Can be "eloket" or "labo". Default is "eloket".
a dataframe containing 2 columns id & label
+a dataframe containing 2 columns: id & label
The input dataframe should a least contain a id_column & labelnummer_column +
The input dataframe should at least contain an id_column & labelnummer_column other values can be 'hardcoded'.
lib_crs.Rd
Library of commonly used coordinate reference system (CRS) codes
+lib_crs
A named list with the following elements:
ID of the CRS
Javascript Object Notation (JSON) of the CRS
EPSG code of the CRS