Skip to content

Commit fc4671b

Browse files
committed
Add JoinManager tests, update docs, rebase on master
1 parent 62e048d commit fc4671b

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
@@ -428,18 +428,47 @@ If you wish to store the join source files in a *specific* directory, you can sp
428428
Automatic cleanup
429429
^^^^^^^^^^^^^^^^^
430430

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

434434
- `max_files`
435435
- `max_days`
436436

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

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

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

444473
.. _API Design Rules:
445474

0 commit comments

Comments
 (0)