View source: R/build_api_query.R
| build_api_query | R Documentation |
A function called by create_custom_lookup.R and geo_get.R to build a valid query.
build_api_query(ref, where_level, where = NULL, fields = "*", sr = 4326)
ref |
an integer, passed by the calling function, that indicates which url_string to use. |
where_level |
The variable name associated with the
locations filter. e.g. |
where |
A vector of names or codes to filter the data by. If nothing is provided then the full table should be returned. |
fields |
The fields of the data to be returned. Defaults to |
sr |
The (EPSG) spatial reference of any returned geometry. 4326 ("WGS 84") by default. Can be specified as numeric or character. |
a string that should function as a valid API query
build_api_query(ref = 4,
where_level = "cauth20nm",
where = "Greater Manchester",
fields = c("lad20cd", "lad20nm", "cauth20cd", "cauth20nm")
)
build_api_query(ref = 12,
where_level = "lad20nm",
where = c(
"Cheltenham", "Gloucester",
"Stroud", "Cotswold",
"Tewkesbury", "Forest of Dean"
),
fields = c("lad20cd", "lad20nm")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.