doc: update filters documentation
parent
db15f93da1
commit
07dbeae13a
|
@ -92,14 +92,14 @@ Some column types require additional arguments. Refer to the documentation of th
|
||||||
``from_member`` is only valid for tables of the type ``relation_member``. If this is set to ``true``, then tags will be used from the member instead of the relation.
|
``from_member`` is only valid for tables of the type ``relation_member``. If this is set to ``true``, then tags will be used from the member instead of the relation.
|
||||||
|
|
||||||
|
|
||||||
``filter``
|
``filters``
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~~
|
||||||
|
|
||||||
You can limit which elements should be inserted into a table with filters.
|
You can limit which elements should be inserted into a table with filters.
|
||||||
You can ``require`` specific tags or ``reject`` elements that have specific tags.
|
You can ``require`` specific tags or ``reject`` elements that have specific tags.
|
||||||
``require`` and ``reject`` accept keys and a list of values, similar to a ``mapping``. You can use ``__any__`` to require or reject all values (e.g. ``amenity: [__any__]``).
|
``require`` and ``reject`` accept keys and a list of values, similar to a ``mapping``. You can use ``__any__`` to require or reject all values (e.g. ``amenity: [__any__]``).
|
||||||
|
|
||||||
``require_regexp`` and ``reject_regexp`` can be used to filter values based on a regular expression.
|
``require_regexp`` and ``reject_regexp`` can be used to filter values based on a regular expression. You can use the `Go Regex Tester <https://regex-golang.appspot.com/assets/html/index.html>`_ to test your regular expressions.
|
||||||
|
|
||||||
The following mapping only imports buildings with a `name` tag. Buildings with ``building=no`` or ``building=none`` or buildings with a non-numeric level are not imported.
|
The following mapping only imports buildings with a `name` tag. Buildings with ``building=no`` or ``building=none`` or buildings with a non-numeric level are not imported.
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ The following mapping only imports buildings with a `name` tag. Buildings with `
|
||||||
tables:
|
tables:
|
||||||
buildings:
|
buildings:
|
||||||
type: polygon
|
type: polygon
|
||||||
filter:
|
filters:
|
||||||
require:
|
require:
|
||||||
name: [__any__]
|
name: [__any__]
|
||||||
reject:
|
reject:
|
||||||
|
@ -124,6 +124,11 @@ The following mapping only imports buildings with a `name` tag. Buildings with `
|
||||||
|
|
||||||
Regular expressions in ``require_regexp`` and ``reject_regexp`` should be enclosed in single quotes (``'``). Otherwise YAML will interpret backslashes as escape sequences.
|
Regular expressions in ``require_regexp`` and ``reject_regexp`` should be enclosed in single quotes (``'``). Otherwise YAML will interpret backslashes as escape sequences.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
You can only filter tags that are referenced in the ``mapping`` or ``columns`` of any table. See :ref:`tags` on how to make additional tags available for filtering.
|
||||||
|
|
||||||
|
|
||||||
Example
|
Example
|
||||||
~~~~~~~
|
~~~~~~~
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue