Skip to content

Commit

Permalink
filter function update
Browse files Browse the repository at this point in the history
  • Loading branch information
sameerpadhye committed Sep 25, 2024
1 parent 961f268 commit d306840
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions R/helper.connect.pvt_public.filters.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

}

Expand All @@ -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)))

}

Expand All @@ -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=.,
Expand All @@ -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(.)))


}
Expand Down

0 comments on commit d306840

Please sign in to comment.