Cells

aggregateIntoCells groups your points into cells, a grid of hexagons or squares or your own polygons, and gives each cell statistics over a value of its points, such as the median price per square metre. It needs no map, so it runs in Node.js too.

aggregateIntoCells

import { aggregateIntoCells } from '@tomtom-org/maps-sdk/core';

const cells = aggregateIntoCells(listings, {
    grid: 'hex',
    cellSizeKM: 1,
    value: 'pricePerSquareMeter',
    stats: ['median', 'count'],
    minCount: 5,
});
// cells.features[0].properties: { median, count }