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 array required v15.0.0

    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 value v15.0.0

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

  • categories array required v15.0.0

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

  • max distance (m) number v15.0.0

    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) number v15.0.0

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

  • include array v15.0.0

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

  • output path value v15.0.0

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

Out pins 5
  • items array v15.0.0

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

  • count number v15.0.0

    Number of items returned.

  • unresolved number v15.0.0

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

  • success condition v15.0.0

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

  • error value v15.0.0

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

A typical wiring for enrich with nearby places: with values feeds the items pin; with values feeds the categories pin; the items out pin feeds length.

Studio canvas example for the enrich with nearby places block: typical wiring for enrich with nearby places.

Used in these guides

These documentation pages use or explain this block:

Version history

Introduced in v15.0.0.


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