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.
- items required
v15.0.0arrayThe list to process. Either an array of geo points, or an array of objects with
point pathnaming where the coordinate sits. - point path
v15.0.0valueDotted 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.0arrayCategory groups to measure, as an array or a comma-separated list. Required : this is what gets measured.
- max distance (m)
v15.0.0numberIgnore 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.0numberRadius used for the per-category
countfield. Empty counts everything the lookup returned. - include
v15.0.0arrayWhich fields to write per category:
distance,name,id,count. Empty writes them all. - output path
v15.0.0valueWhere to write the result on each item. Empty uses
places.
- items
v15.0.0arrayThe items, each with the enrichment added. Same order and same length as the input.
- count
v15.0.0numberNumber of items returned.
- unresolved
v15.0.0numberItems that had no usable coordinate. They are still returned, just not enriched : check this before trusting a write-back.
- success
v15.0.0conditionTrue when the query ran. An empty result is still a success.
- error
v15.0.0valueError code when the query could not run:
PLACES_NOT_AVAILABLE,CATEGORIES_REQUIRED.
Core Releases
v15.0.0 This block was introduced inv15.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
