From d3068402dd1d2fc146898a13dc880875419bf764 Mon Sep 17 00:00:00 2001 From: Sameer Padhye Date: Wed, 25 Sep 2024 12:44:31 -0400 Subject: [PATCH] filter function update --- R/helper.connect.pvt_public.filters.R | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/R/helper.connect.pvt_public.filters.R b/R/helper.connect.pvt_public.filters.R index 380ec08..76200aa 100644 --- a/R/helper.connect.pvt_public.filters.R +++ b/R/helper.connect.pvt_public.filters.R @@ -185,9 +185,9 @@ if (!is.null(shapefile)) # Input data as a file path. The shapefile is simplified to avoid large shapefile issues - suppressWarnings(suppressMessages(shp_input= sf::st_read(shapefile)%>%st_simplify(dTolerance = 0.001))) + shp_input= suppressWarnings(suppressMessages(sf::st_read(shapefile)%>%st_simplify(dTolerance = 0.001))) - suppressWarnings(suppressMessages(shp_input = st_transform(shp_input,4326))) + shp_input = suppressWarnings(suppressMessages(st_transform(shp_input,4326))) } @@ -201,9 +201,9 @@ if (!is.null(shapefile)) shp_input=shapefile - suppressWarnings(suppressMessages(shp_input = st_transform(shp_input,4326))) + shp_input = suppressWarnings(suppressMessages(st_transform(shp_input,4326))) - suppressWarnings(suppressMessages(shp_input=shp_input%>%st_simplify(dTolerance = 0.001))) + shp_input=suppressWarnings(suppressMessages(shp_input%>%st_simplify(dTolerance = 0.001))) } @@ -216,7 +216,7 @@ if (!is.null(shapefile)) } - suppressWarnings(suppressMessages(spatial.bold.df= bold.df%>% + spatial.bold.df= suppressWarnings(suppressMessages(bold.df%>% convert_coord_2_lat_lon(.)%>% tidyr::drop_na(lat,lon)%>% sf::st_as_sf(x=., @@ -225,14 +225,14 @@ if (!is.null(shapefile)) remove=FALSE))) - suppressWarnings(suppressMessages(spatial.bold.df=st_transform(spatial.bold.df, + spatial.bold.df=suppressWarnings(suppressMessages(st_transform(spatial.bold.df, st_crs(shp_input)))) - bold.df=st_intersection(spatial.bold.df, + bold.df==suppressWarnings(suppressMessages(st_intersection(spatial.bold.df, shp_input)%>% sf::st_drop_geometry(.)%>% - data.frame(.) + data.frame(.))) }