getSQLSardaraQueries: Get a list of queries to execute to plug services to the...

View source: R/getSQLSardaraQueries.R

getSQLSardaraQueriesR Documentation

Get a list of queries to execute to plug services to the datasets available in Sardara

Description

Get a list of queries to execute to manage the datasets available in Sardara (extract in csv format, in netcdf, etc.)

Usage

getSQLSardaraQueries(con,dataset_metadata)

Arguments

con

a wrapper of rpostgresql connection (connection to a database)

dataset_metadata

data.frame of type "metadata" (one row extracted from the table metadata.metadata).

Value

a list with SQL queries and informations on the dataset. Depending on the type of data (raw_dataset, codelist, mapping), the output elements of the list might vary. The elements of the list are:

  • query_CSV : Query to retrieve a data.frame with the codes

  • query_CSV_with_labels : Query to retrieve a data.frame with codes and labels (for raw_datasets)

  • query_NetCDF :

  • query_wfs_wms :

  • query_wfs_wms_aggregated_layer :

  • query_dynamic_list_keywords_species :

  • query_dynamic_list_keywords_fishing_gears :

  • query_dynamic_list_keywords_Fleets :

  • query_dynamic_metadata_count_features :

  • query_dynamic_metadata_spatial_Extent :

  • query_dynamic_metadata_temporal_Extent :

  • query_dynamic_metadata_get_SRID :

  • lineage :

  • query_dynamic_list_keywords_institutions :

Author(s)

Paul Taconet, paul.taconet@ird.fr

See Also

Other access data: extract_dataset

Examples


# Connect to Tuna atlas database
con<-db_connection_tunaatlas_world()
 
 # retrieve metadata row of dataset global_catch_5deg_1m_1950_01_01_2016_01_01_tunaatlasIRD_level1
dataset_metadata<-list_metadata_datasets(con,identifier="global_catch_5deg_1m_1950_01_01_2016_01_01_tunaatlasIRD_level1")
queries<-getSQLSardaraQueries(con,dataset_metadata)

# retrieve data.frame of global_catch_5deg_1m_1950_01_01_2016_01_01_tunaatlasIRD_level1

global_catch_5deg_1m_1950_01_01_2016_01_01_tunaatlasIRD_level1<-dbGetQuery(con,queries$query_CSV)


ptaconet/rtunaatlas documentation built on June 23, 2024, 9:35 p.m.