Skip to content

Commit 0131270

Browse files
committed
Add JoinManager tests, update docs, rebase on master
1 parent 60ba487 commit 0131270

File tree

2 files changed

+927
-3
lines changed

2 files changed

+927
-3
lines changed

docs/source/configuration.rst

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,18 +418,47 @@ If you wish to store the join source files in a *specific* directory, you can sp
418418
Automatic cleanup
419419
^^^^^^^^^^^^^^^^^
420420

421-
Without any further configuration, the amount of join source files could grow indefinitely.
422-
To control the number of files and/or days they are stored, you can set the following parameters:
421+
Without any further configuration, the amount of join source files could grow indefinitely (not recommended).
422+
To control the number of files and/or days they are stored *for each collection*, you can set the following parameters:
423423

424424
- `max_files`
425425
- `max_days`
426426

427-
Both parameters can be set to an integer. If omitted, no cleanup rule will be set.
427+
Both parameters can be set to an integer. If omitted, **no cleanup rule** will be set.
428428
Note that the settings are *not* mutually exclusive: you can also set both options.
429429

430430
The automatic cleanup is a lazy process and does not run as a scheduled background task: the process will only run
431431
when a new join source file is uploaded or when pygeoapi initializes (if OGC API - Joins is enabled).
432432

433+
Key fields
434+
^^^^^^^^^^
435+
436+
For *feature collections* only, you may define some key fields on which a join can be performed.
437+
These key fields are defined in the `providers` section of the collection configuration.
438+
439+
Key fields must be of type `string` or `integer`. Joining on (e.g.) dates or floats is not possible.
440+
441+
An example configuration could look like this:
442+
443+
.. code-block:: yaml
444+
providers:
445+
- type: feature
446+
name: GeoJSON
447+
data: tests/data/dutch_municipalities.json
448+
key_fields:
449+
- name: jaarcode
450+
- name: statcode
451+
default: true
452+
- name: jrstatcode
453+
454+
Note that 3 key fields have been defined above (`jaarcode`, `statcode`, `jrstatcode`),
455+
for which `statcode` is marked as the default field. In that case, that field will be used
456+
as the field to join on if nothing was specified.
457+
458+
Be aware that if you do not specify any key field, the feature identifier (e.g. `id`) will be used
459+
as the default field to join on. In fact, the feature identifier will always be included as a key field,
460+
even if specific key fields were configured.
461+
433462

434463
.. _API Design Rules:
435464

0 commit comments

Comments
 (0)