diff --git a/planetiler-custommap/README.md b/planetiler-custommap/README.md index 539140d8..160fd58e 100644 --- a/planetiler-custommap/README.md +++ b/planetiler-custommap/README.md @@ -469,41 +469,32 @@ value: "${ 8 * 24 - 2 }" Scripts are parsed and evaluated inside a "context" that defines the variables available to that script. Contexts are nested, so each child context can also access the variables from its parent. -> ##### root context -> -> Available variables: -> - `args` - a map from [argument](#arguments) name to value, see also [built-in arguments](#built-in-arguments) that -> ->> are always available. ->> ->> ##### process feature context ->> ->> Context available when processing an input feature, for example testing whether to include it from `include_when`. ->> Available variables: ->> ->> - `feature.tags` - map with key/value tags from the input feature ->> - `feature.id` - numeric ID of the input feature ->> - `feature.source` - string source ID this feature came from ->> - `feature.source_layer` - optional layer within the source the feature came from ->> - `feature.osm_changeset` - optional OSM changeset ID for this feature ->> - `feature.osm_version` - optional OSM element version for this feature ->> - `feature.osm_timestamp` - optional OSM last modified timestamp for this feature ->> - `feature.osm_user_id` - optional ID of the OSM user that last modified this feature ->> - `feature.osm_user_name` - optional name of the OSM user that last modified this feature ->> ->>> ##### post-match context ->>> ->>> Context available after a feature has matched, for example computing an attribute value. Adds variables: ->>> ->>> - `match_key` - string tag that triggered a match to include the feature in this layer ->>> - `match_value` - the tag value associated with that key ->>> ->>>> ##### configure attribute context ->>>> ->>>> Context available after the value of an attribute has been computed, for example: set min zoom to render an ->>>> attribute. Adds variables: ->>>> ->>>> - `value` the value that was computed for this key +##### 1. Root Context +Available variables: +- `args` - a map from [argument](#arguments) name to value, see also [built-in arguments](#built-in-arguments) that are always available. + +##### 2. Process Feature Context +Context available when processing an input feature, for example testing whether to include it from `include_when`. +Available variables: +- `feature.tags` - map with key/value tags from the input feature +- `feature.id` - numeric ID of the input feature +- `feature.source` - string source ID this feature came from +- `feature.source_layer` - optional layer within the source the feature came from +- `feature.osm_changeset` - optional OSM changeset ID for this feature +- `feature.osm_version` - optional OSM element version for this feature +- `feature.osm_timestamp` - optional OSM last modified timestamp for this feature +- `feature.osm_user_id` - optional ID of the OSM user that last modified this feature +- `feature.osm_user_name` - optional name of the OSM user that last modified this feature + +##### 3. Post-Match Context +Context available after a feature has matched, for example computing an attribute value. Adds variables: +- `match_key` - string tag that triggered a match to include the feature in this layer +- `match_value` - the tag value associated with that key + +##### 4. Configure Attribute Context +Context available after the value of an attribute has been computed, for example: set min zoom to render an +attribute. Adds variables: +- `value` the value that was computed for this key For example: