Wolfram Language

Compute Urban Population Spatial Center

The spatial median of a dataset finds a point that minimizes total distance to every point in the data: . Spatial median may not belong to the original dataset. SpatialMedian works with many distance functions and allows for the distances to be weighted by assigning weights to the points using WeightedData.

Compute the spatial median of a state in the contiguous US based on the locations of the main cities and compare it to the spatial median of the same cities but weighted by their populations.

Compute the spatial median of the cities.

Compute the spatial median of the cities weighted by their population.

Compute the distance between the two medians.

The plot shows that despite cities being dispersed all over the state, most of the urban population lives in the southeast part of the state.

show complete Wolfram Language input

Related Examples

de es fr ja ko pt-br zh