enrich with nearby places

This block is part of the places group and was last modified in core v15.0.0.

enrich with nearby places v15.0.0

Adds the nearest place per category to every item in a list, in one call : no iterator needed. The usual pipeline is: query your objects, run this block, then write the result back with a mutation. After that an ordinary range query filters on the stored distance, so no further lookups are needed. Each item gets {distance_m, name, id, count} per category under output path. Items are copied, never modified in place, and every item is returned whether or not it had a usable coordinate.

In pins 7
  • items required v15.0.0
    array

    The list to process. Either an array of geo points, or an array of objects with point path naming where the coordinate sits.

  • point path v15.0.0
    value

    Dotted path to the geo point inside each item, e.g. general.location. Leave empty when the items are geo points themselves.

  • categories required v15.0.0
    array

    Category groups to measure, as an array or a comma-separated list. Required : this is what gets measured.

  • max distance (m) v15.0.0
    number

    Ignore places beyond this distance. Empty searches without a limit, so every item gets a distance however far away the nearest place is.

  • count radius (m) v15.0.0
    number

    Radius used for the per-category count field. Empty counts everything the lookup returned.

  • include v15.0.0
    array

    Which fields to write per category: distance, name, id, count. Empty writes them all.

  • output path v15.0.0
    value

    Where to write the result on each item. Empty uses places.

Out pins 5
  • items v15.0.0
    array

    The items, each with the enrichment added. Same order and same length as the input.

  • count v15.0.0
    number

    Number of items returned.

  • unresolved v15.0.0
    number

    Items that had no usable coordinate. They are still returned, just not enriched : check this before trusting a write-back.

  • success v15.0.0
    condition

    True when the query ran. An empty result is still a success.

  • error v15.0.0
    value

    Error code when the query could not run: PLACES_NOT_AVAILABLE, CATEGORIES_REQUIRED.

Core Releases

v15.0.0 This block was introduced in v15.0.0, click here to see the release notes.
Back to places Return to the main group to view all sub-groups Back to Places Return to the group to view all blocks within this group