Methods
What each figure means, how it is calculated, and what it assumes. The code is in src/metrics.js and is checked against cases with known answers (a perfect grid, a circle, a square building) in test/metrics.test.mjs.
The area analysed
The frame is the visible map, reduced to at most 2 by 2 km around its centre. Streets and places are also fetched for 800 m around the frame, so that walking routes and the nearest shop are not cut off at its edge; buildings are counted when their centre lies inside the frame. All lengths and areas are computed in metres on a local flat projection centred on the frame (error under 0.1% at this size). Densities divide by the frame's area, which includes water and open land: a riverside frame reads as less dense.
The data, and what OpenStreetMap does not hold
OpenStreetMap (OSM) is mapped by volunteers. Streets are near-complete in most cities; buildings are complete in many but not all; heights, floors, widths and speed limits are often missing. Each section reports how much of the area is tagged. OSM holds no population counts, so there is no population figure here: use a census or a gridded product such as the Global Human Settlement Layer (GHSL) or WorldPop.
Streets
Streets are the OSM ways a pedestrian can use: every highway=* except motorways, trunk roads without a pavement,
construction, and private or no-foot access. They are turned into a graph: nodes where streets end or meet, edges
along the streets between them, as OSMnx does (Boeing 2017). Two networks are used. Measures of structure (length,
intersections, streets per node, block edges, circuity, meshedness, orientation) use streets proper: carriageways from trunk roads to
residential streets, living streets and pedestrian streets. Separately mapped pavements, crossings, paths, steps, cycleways and service
roads are left out, because in places where mappers draw every pavement and crossing they would multiply the intersections several times
over, and the measure would describe mapping style rather than the city. Walking routes (access to everyday needs, the walk
distances on the map) use every walkable way, paths and pavements included.
- Street length and density
- Total length of edges whose midpoint lies in the frame, and that length per km².
- Intersections
- Nodes where three or more street ends meet, per km². A standard measure of how finely the street network is divided: higher means more route choices and shorter blocks.
- Streets per node and dead ends
- The mean number of street ends at each node (nodes where exactly two meet, simply a bend or a change of tags, are not counted). Dead ends are nodes with one street end. Two shares are given: for vehicles (the street ends) and on foot (the street ends and no path, crossing or square carries on from it). A gap between them is filtered permeability: streets closed to traffic but open to walking and cycling. The heading's "many cul-de-sacs" uses the share on foot. A frame edge can cut a street and create a false dead end; counting only nodes inside the frame, with the network fetched beyond it, avoids this.
- Block edge length
- Mean edge length: a proxy for block size along the street.
- Circuity and route directness
- Circuity is the total edge length divided by the total straight-line distance between each edge's ends (1 for straight streets). Route directness takes up to 480 random pairs of intersections 300 to 1,500 m apart and divides the shortest network distance by the straight-line distance; the median is shown. A value of 1.3 means a typical walk is 30% longer than as the crow flies; a perfect grid gives about 1.27 on average for random directions.
- Meshedness
- α = (e − v + 1) / (2v − 5), the number of independent loops relative to the most a planar network of that size can have (Buhl et al. 2006): 0 for a tree (cul-de-sac estates), towards 1 for a dense mesh.
- Orientation order
- Street bearings, each segment counted in both directions and weighted by length, are binned in
36 bins of 10°. Their Shannon entropy H is compared with a perfect grid (all length in 4 bins, Hg = ln 4) and with complete
disorder (Hmax = ln 36):
φ = 1 − ((H − Hg) / (Hmax − Hg))²
which runs from 0 (no prevailing direction) to 1 (a perfect grid) (Boeing 2019). The rose diagram shows the bins. - Street width
- From
widthwhere tagged; otherwiselanes× 3 m (an assumption, stated); otherwise unknown. The median of the streets that have either is shown, with how many do.
Buildings
Buildings are often mapped years after streets. When buildings cover under 12% of the frame although it has more than 80 intersections per km², the analysis warns that buildings look incompletely mapped.
- Count and density
- Building outlines (
building=*, including the outer rings of multipolygons) whose centre is in the frame, per hectare. - Footprints
- Area of each outline by the shoelace formula; mean and median.
- Heights and floors
- Floors from
building:levels; otherwise fromheight÷ 3 m, rounded. Height fromheight; otherwise floors × 3 m. - Spacematrix: GSI, FSI, L and OSR
- Berghauser Pont and Haupt (2010) describe density by four linked numbers:
GSI = footprint area / frame area FSI = floor area / frame area L = FSI / GSI OSR = (1 − GSI) / FSI
GSI is ground coverage; FSI the floor area ratio (floor space index); L the mean number of floors; OSR the open space per square metre of floor. Floor area is footprint × floors. Where floors are not tagged, the building is given the median of tagged buildings in the frame, and FSI is reported only if at least 20% of buildings are tagged; the method used is printed beside it. The label simplifies the Spacematrix: spacious (GSI < 0.15), compact (0.15–0.35), very compact (> 0.35); low-rise (L < 3), mid-rise (3–6), high-rise (> 6). Frames include streets and open land, so these are gross, not plot, densities.
Places, access and indices
- Mix of uses
- Places are sorted into eight kinds (groceries; eating and drinking; education; health; parks and play;
other shops; services and civic; culture), from OSM
amenity,shop,leisure,healthcareandtourismtags. The mix is their Shannon entropy divided by ln 8: 0 if all places are of one kind, 1 if all kinds are equally common. - Everyday needs on foot
- From the street node nearest the frame's centre, the shortest walk along streets (plus the straight gaps to and from the network) to the nearest place of each everyday kind, public transport included. Each kind scores 1 within 400 m, falling linearly to 0 at 1,600 m (5 and 20 minutes at 4.8 km/h); the index is the mean score × 100. The count of kinds within 1,200 m (15 minutes) follows the idea of the 15-minute city (Moreno et al. 2021). The decay is modelled on that used by commercial walk scores, but this is not any proprietary score.
- Walkability
- The mean of three parts, each 0–1: connectivity (intersection density ÷ 150 per km², capped at 1), land-use mix, and access to everyday needs. This follows the structure of research walkability indices (Frank et al. 2010: connectivity, mix and density), without residential density, which OSM cannot give.
- Cyclability
- 0.5 × cycle infrastructure (length of carriageways with a cycle lane or track, plus separate cycleways, as a share of carriageway length, divided by 0.3 and capped at 1; paths shared with pedestrians, bus lanes open to cycles, and tags saying the track is mapped separately are not counted, the last to avoid counting one track twice) + 0.3 × share of speed-tagged streets limited to 30 km/h (20 mph) or less + 0.2 × connectivity. The weights are a judgement, shown so they can be argued with; the parts are shown beside the index.
- Public transport
- Bus stops, platforms, tram stops and stations within 400 m of the centre, and rail or metro stations within 800 m, straight-line. OSM rarely holds timetables, so frequency, the most important part of transit access, is not measured.
Neighbourhood type
The heading of each analysis combines four readings: streets grid-like (φ > 0.5), semi-regular (0.2–0.5) or irregular (< 0.2); many cul-de-sacs (dead ends over 25%) or finely connected (over 120 intersections per km²); the Spacematrix label; and mixed uses (mix over 0.6), some mixed uses (0.3–0.6) or mostly single use. It is a description, not a classification learned from data.
References
- Berghauser Pont, M. and Haupt, P. (2010). Spacematrix: Space, Density and Urban Form. Rotterdam: NAi Publishers.
- Boeing, G. (2017). OSMnx: New methods for acquiring, constructing, analyzing, and visualizing complex street networks. Computers, Environment and Urban Systems 65, 126–139. doi:10.1016/j.compenvurbsys.2017.05.004
- Boeing, G. (2019). Urban spatial order: street network orientation, configuration, and entropy. Applied Network Science 4, 67. doi:10.1007/s41109-019-0189-1
- Buhl, J. et al. (2006). Topological patterns in street networks of self-organized urban settlements. The European Physical Journal B 49, 513–522. doi:10.1140/epjb/e2006-00085-1
- Fleischmann, M. (2019). momepy: Urban Morphology Measuring Toolkit. Journal of Open Source Software 4(43), 1807. doi:10.21105/joss.01807
- Frank, L. D. et al. (2010). The development of a walkability index: application to the Neighborhood Quality of Life Study. British Journal of Sports Medicine 44, 924–933. doi:10.1136/bjsm.2009.058701
- Moreno, C. et al. (2021). Introducing the “15-Minute City”. Smart Cities 4(1), 93–111. doi:10.3390/smartcities4010006
Map data © OpenStreetMap contributors, available under the Open Database Licence.