Skip to content

Commit

Permalink
filter function update for shapefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
sameerpadhye committed Sep 25, 2024
1 parent cd238c9 commit 961f268
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 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

shp_input= suppressWarnings(suppressMessages(sf::st_read(shapefile)%>%st_simplify(dTolerance = 0.001)))
suppressWarnings(suppressMessages(shp_input= sf::st_read(shapefile)%>%st_simplify(dTolerance = 0.001)))

shp_input = suppressWarnings(suppressMessages(st_transform(shp_input,4326)))
suppressWarnings(suppressMessages(shp_input = st_transform(shp_input,4326)))

}

Expand All @@ -201,9 +201,9 @@ if (!is.null(shapefile))

shp_input=shapefile

shp_input = suppressWarnings(suppressMessages(st_transform(shp_input,4326)))
suppressWarnings(suppressMessages(shp_input = st_transform(shp_input,4326)))

shp_input=suppressWarnings(suppressMessages(shp_input%>%st_simplify(dTolerance = 0.001)))
suppressWarnings(suppressMessages(shp_input=shp_input%>%st_simplify(dTolerance = 0.001)))

}

Expand All @@ -216,7 +216,7 @@ if (!is.null(shapefile))
}


spatial.bold.df= suppressWarnings(suppressMessages(bold.df%>%
suppressWarnings(suppressMessages(spatial.bold.df= bold.df%>%
convert_coord_2_lat_lon(.)%>%
tidyr::drop_na(lat,lon)%>%
sf::st_as_sf(x=.,
Expand All @@ -225,7 +225,7 @@ if (!is.null(shapefile))
remove=FALSE)))


spatial.bold.df=suppressWarnings(suppressMessages(st_transform(spatial.bold.df,
suppressWarnings(suppressMessages(spatial.bold.df=st_transform(spatial.bold.df,
st_crs(shp_input))))


Expand Down

0 comments on commit 961f268

Please sign in to comment.