Description:
R Package with functionalities to access and analyse spatial data in Cefas Spatial Hub. The package include funcitons for: - Access to Spatial Hub web services from R - The Spatial Hub web service are accesible as spatial objects or R Data Frame - Use the Spatial Hub web service API to run some analysis on the Sptial Hub servers side ( enhance speed perfomance)
Imports: httr, jsonlite, sf
Install the package form Github and load the library
library (devtools) ## Install "devtools" if not available
install_github("CefasRepRes/cefasSpatialHubPackage", build_vignettes = TRUE) ## Skip updates to avoid issues ( option 3 )
library (cefasSpatialHub)
Get data form Spatial Hub Web Service and plot a map
landings_map = getWebServiceData ( web_service= "https://giserver.cefas.co.uk/devserver/rest/services/fishing_activity/Landing_composition_statistics_by_species_ICES_rectangles_and_ports_2009_to_2021/MapServer",
layer_index = 8,
where_clause = "ft_lyear = 2021 AND le_spe = 'COD'",
output_fields = "*",
spatial_layer = TRUE )
landings_map %>% slice ( 1:100 ) %>% ggplot ( aes( fill = total_tons, color = total_tons) ) + geom_sf ( )
Access to function helps document
?getWebServicesData
?getWebServicesFields
browseVignettes("cefasSpatialHub")
help("cefasSpatialHub")