pdokr 0.2.0
CRAN release: 2026-11-26
- Support for server-side attribute filtering with CQL2, which PDOK offers on every dataset with OGC API Features (each layer exposes a selected set of filterable fields):
-
pdok_read()gains afilterargument: apdok_where()expression or a raw CQL2 text string, executed by the server so only matching features are downloaded. It combines withbbox/filter_by(conditions are combined with AND). -
pdok_where()translates R syntax (==,%in%,&,has(),like(),casei(), …) to CQL2. A%in%over more than 300 values is split over multiple requests automatically (with a progress bar), so filtering on thousands of ids works out of the box;has()matches one value inside multi-value fields such as the BAGgebruiksdoel. -
pdok_list_queryables()lists the fields a filter can use for a layer, andpdok_list_layers()gains aqueryables = TRUEoption that adds them as a column for every layer of a dataset.
-
-
pdok_read()with a small set of points asfilter_by(up to 200, within roughly 20 km) now also asks the server for only the features touching those points, via a spatial CQL2 filter. “Which building/municipality does each of these addresses fall in” thus downloads those features instead of everything in the points’ bounding box. The exact client-side clip and thepredicatesemantics are unchanged. - New
pdok_read_href()follows the feature links that some layers carry (such aspand.hrefon a BAGverblijfsobject). It reads each distinct linked feature once, with bounded concurrency and a rate limit, and attaches it to the rows that link to it, like a join that also brings the linked geometry along.keep = FALSEreturns just the linked features. This is the efficient way to get, for example, the buildings behind a list of addresses. - HTTP error messages now include the server’s own explanation when the response provides one (e.g. CQL2 parse errors). A filter on a field that is not queryable additionally points to
pdok_list_queryables().
pdokr 0.1.0
CRAN release: 2026-07-22
- First release.
pdokrprovides:- Dataset and layer discovery with
pdok_list_datasets(),pdok_search_datasets(),pdok_list_layers()andpdok_search_layers(), fetched live from the PDOK index. - Loading layers as
sfobjects withpdok_read(), with automatic pagination, server-side bounding-box and temporal pre-filtering, and client-side CRS transformation.pdokris an OGC API Features client and reads vector features only; a dataset that serves tiles or coverages instead is reported with a clear error. - Spatial filtering by any polygon (or point) with
pdok_filter_by(), also available in one call through thefilter_byargument ofpdok_read(). - Geocoding of addresses and place names with
pdok_geocode(), returningsfpoints and administrative polygons.queryaccepts a vector, so many locations can be geocoded in one call; aquerycolumn maps each result row back to its input. - Reverse geocoding with
pdok_reverse_geocode():sfpoints to the nearest address, road or place, with the distance in meters. - The official PDOK basemap as a map background with
pdok_basemap(), returning a raster tile URL (tmap/leaflet) or a vector style URL (maplibre/mapgl).
- Dataset and layer discovery with
