garage44.eu/jeroen/cartopolis

logclone: git clone https://garage44.eu/jeroen/cartopolis.git

.. /docs/notes/parked-vehicles.md

raw


topic: parked-vehicles triggers: [parking.rs, furniture.rs, "parked car", "parked cars", "bicycle parking", "sites layer", "car park", "vehicles", "more lively", "inhabited", world_places.rs, park_in_bays, parking bays, parkeervakken] updated: 2026-10-19

The car parks are filled, and the cars are inferred

cartopolis_geo::parking (2026-08-26) fills the sites layer's parking and bicycle_parking polygons with parked vehicles. It rides map_geometry's existing fetch, parse, worker and per-cell batching, joins the street furniture's SurfaceGroup::Furniture mesh and material, and answers to the same Street furniture toggle — so collision matches what is drawn, which is the rule collision::sync_prop_colliders exists for.

Before this, sites (84 features in the Groningen z14 fixture, 56 of them parking) was one flat grey fill and nothing else.

The claim it makes, and the one it refuses

OSM surveys the lot, never the cars in it. The polygon is real, its orientation is real, and its capacity is implied by its area; every individual vehicle is invented. So:

That is the same line the tree scatter and the fill palette already draw — an unstyled polygon beats a wrongly styled one.

Four decisions in the layout

The access road is kept clear with scatter::RoadMask for the reason the tree scatter needs it: a lot's entrance is interior to the polygon, because Shortbread draws the carriageway on top rather than punching a hole, so no boundary inset can see it.

Measured, and what bounds it

2026-08-26, Groningen z14 fixture (parking::tests::survey_the_fixture): 531 vehicles — 215 cars, 316 bikes — costing 3.5 MB of mesh (before the 2026-10-19 bodies below). A car was seven boxes (4.40 × 1.72 × 1.45 m, body clear of the ground so the wheels reach under it), a bike is four.

The seventh box is a body-coloured roof over the glass, and it is worth its 17%: with the greenhouse as the topmost part, a capture from 25 m showed every car as an identical dark grey rectangle — from above, which is where this camera spends most of its time, the whole per-instance paint scheme was a thin skirt under the windows. Glazing you can see through the side of reads as a car; a tinted sunroof over the entire cabin does not.

Every other producer in this crate is bounded by a survey: there are as many benches as OSM recorded. A lot fill is bounded by the ground it covers, so the count is the thing that has to be capped, and MAX_VEHICLES_PER_CELL (900) is close to a working limit rather than the pure headroom MAX_FURNITURE_PER_CELL is. Hitting it costs whole lots at the end of the layer — an empty car park beside a full one is what that looks like — and it is logged.

This is why build_furniture_meshes now takes a max_bytes and cuts, as build_vegetation_meshes does. One mesh per cell was safe while the group's whole vocabulary was surveyed points; an area fill is what made the canopies the largest asset in the app, and it would have done the same here. The cut is taken between objects, so no car loses its wheels. Note the ceiling bounds the rate, not the total: docs/notes/upload-bursts.md on why residency is the other half.

Most of them are street-side strips, not lots

Worth knowing before tuning the aisle module: in a residential tile the parking polygons are mostly kerbside parking strips — long shapes a bay or two wide, running along the street — rather than the open lots the layout was designed for. So what the fill mostly produces is cars parked down residential streets, and the two-rows-and-an-aisle module rarely comes into play there. That is a better result for the goal than a car park would have been, and it is the reason the inset and the road keep-out matter more than the module does.

Where a city surveys its bays, the bays win (2026-10-19)

Groningen registers every public parking bay as its own polygon (34,994; OSM has 1,741), served by atlas's registers dataset. park_in_bays puts one car in each — a different and stronger claim than the lot fill, since only whether this bay is taken is invented — and extract_parking_around leaves out every OSM lot that contains a surveyed bay's centre, so a lot is never parked twice. Lots with no surveyed bay in them (private car parks) are filled as before. The numbers and the bay sizes are in municipal-registers.md.

Known limits, none worth a request to fix

Colour

Bodies are painted per instance out of CAR_PAINTS / BIKE_PAINTS through the new Tone::Paint, which reads FurnitureInstance::paint instead of the tone table — the one part of the furniture scheme that varies within a form. It has to work that way because the group has a single shared material: the variety is carried by the vertex colours, exactly as the canopy's two tones are.

The palette is muted on purpose and is the one place this layer visibly departs from reality. Real traffic is the most saturated thing in a street; this map is pale cartographic paper (systems::vegetation), and a car park in real car colours is instantly the loudest object on screen. Silver, white and graphite are most of any Dutch lot anyway, with two desaturated hues to break up the grey and nothing brighter.

The cars are the moving traffic's bodies (2026-10-19)

Asked for parked cars "similar" to the moving ones, the seven-box form gave way to agent_models::CarBody — hatchback, saloon, estate, van, chosen by a hash of the bay's position so a lot streams back identically — at Detail::Parked: no underside, sills, grille, mirrors or hubs, octagonal wheels, plates and lamps as single quads, and every quad sharing its four vertices. Measured by agent_models::tests::a_parked_car_stays_cheap and survey_the_fixture; see the commit for the numbers. Paint is still per vertex (push_parked_car): the body carries the instance's paint, the trim its own colours as multipliers over the furniture material, like every tone. form::CAR remains for anything that asks for the boxes.