Geospatial · Areas and surfaces
Gravity Model
Splits each area's demand between the locations in range by their attractiveness and distance (the Huff model). Gives the demand each location captures, such as a new store's sales and what it takes from the others, the top location per area, or a probability for every area and location.
Also known as: Huff model, market share, site selection
How it works
Wire the demand table (origins such as census blocks) into the first input and the locations (your stores and competitors) into the second. Pick the Demand geometry column, an optional Demand column (blank means every origin counts 1), the Locations geometry column, the Location id column and an optional Attractiveness column (blank treats every location as equal). Distance measure is Straight line by default; Drive time and Drive distance need routing tiles and a Travel mode. Locations beyond the Search limit (30 km by default, minutes under Drive time) are ignored.
Each origin's demand is split by the Huff model: probability = attractiveness^α × decay(distance) / sum over locations in range, with Distance decay set to Power (the default, exponent β = 2) or Exponential, and the Attractiveness exponent α (1). Output picks the shape: Location summary adds captured_demand, market_share and origins_reached to each location; Origin summary adds top_location, top_probability and locations_in_range to each origin; Pairs (origin × location) gives one row per pair with location_id, distance_km (travel_minutes under Drive time), probability and expected_demand. α, β and the search limit can also be bound to a params table from Calibrate Gravity Model.
Inputs and outputs
Inputs
demand— Tablelocations— Table
Outputs
data— Table
Settings
The Attributes panel of Gravity Model, as in the app: the controls work, but nothing runs — there is no data behind it.
The same settings, as the Assistant writes them
{
originGeometryColumn: string
demandColumn?: string
locationGeometryColumn: string
locationIdColumn: string
attractivenessColumn?: string
distanceMeasure: "straight"|"drive-time"|"drive-distance"
decay: "power"|"exponential"
alpha: number
beta: number
searchLimit: number
output: "locations"|"origins"|"pairs"
costing: "auto"|"bicycle"|"pedestrian"|"truck"
}inputs: demand (origins) then locations (stores, own + competitors). Huff model: probability = attractiveness^alpha × decay(distance) / sum over locations in range. searchLimit is km (minutes on drive-time). output "locations" (default) appends captured_demand, market_share, origins_reached to each location; "origins" appends top_location, top_probability, locations_in_range to each origin; "pairs" is one row per origin x location in range appending location_id, distance_km (travel_minutes on drive-time), probability, expected_demand. Use for market share, new-site sales forecasts and cannibalisation (Union a candidate site onto the locations and compare runs). Never emit tile-set ids or paths.
Example
For a candidate site, Union it onto the locations table, run with Location summary, and compare captured_demand per store against a run without it to see what the new site takes from each store.