Skip to contents

Retrieves the queryables of a layer: the fields that a CQL2 filter expression (see the filter argument of pdok_read() and pdok_where()) is allowed to reference. Every PDOK dataset with OGC API Features supports CQL2 filtering, but the set of filterable fields is chosen per layer and is often a small subset of the layer's attributes, so check it before writing a filter.

Usage

pdok_list_queryables(dataset, layer)

Arguments

dataset

A dataset id from pdok_list_datasets(), or a raw OGC API base URL.

layer

A layer id from pdok_list_layers().

Value

A tibble with one row per filterable field and columns queryable, type, and description.

See also

pdok_read() and pdok_where() to use these fields in a filter; pdok_list_layers(dataset, queryables = TRUE) for the queryables of every layer of a dataset at once.

Examples

# \donttest{
pdok_list_queryables("kadaster/bag", "adres")
#> # A tibble: 11 × 3
#>    queryable                     type           description                     
#>    <chr>                         <chr>          <chr>                           
#>  1 bronhouder_identificatie      string         Filter features by this property
#>  2 geometry                      geometry-point NA                              
#>  3 huisnummer                    string         Filter features by this property
#>  4 identificatie                 string         Filter features by this property
#>  5 openbare_ruimte_identificatie string         Filter features by this property
#>  6 openbare_ruimte_naam          string         Filter features by this property
#>  7 postcode                      string         Filter features by this property
#>  8 provincie_naam                string         Filter features by this property
#>  9 status                        string         Filter features by this property
#> 10 woonplaats_identificatie      string         Filter features by this property
#> 11 woonplaats_naam               string         Filter features by this property

# Often only a few of a layer's fields are filterable
pdok_list_queryables("cbs/gebiedsindelingen", "gemeente_gegeneraliseerd")
#> # A tibble: 2 × 3
#>   queryable type                  description                     
#>   <chr>     <chr>                 <chr>                           
#> 1 geometry  geometry-multipolygon NA                              
#> 2 jaarcode  integer               Filter features by this property
# }