City Defense

About › Building heights in OpenStreetMap

Building heights in OpenStreetMap: why a building is too low in the game and how to fix it

Yes, OpenStreetMap has building heights – but only for some buildings. Height is recorded with the height tag (in meters) or building:levels (the number of above-ground floors). OpenMapTiles map tiles turn these into render_height: the height, otherwise floors × 3.66 m, otherwise 5 m. City Defense uses that value as it is, so a building without data is 5 m tall in the game. Anyone can fix that directly in OpenStreetMap.

Updated

City Defense is free to play in your browser – no download, no sign-up. First mission: Brno, náměstí Svobody.

Play free

How OpenStreetMap records a building's height

TagWhat it meansExample
heightheight from the lowest point at ground level to the top of the building, roof included (antennas and masts excluded), in metersheight=18
building:levelsnumber of above-ground levels in the facade – excluding roof levels and underground levels; whole numbers onlybuilding:levels=5
roof:levelslevels inside the roof (attic floors)roof:levels=1
min_height, building:min_levelwhere a part of a building starts if it doesn't stand on the ground (an overhang, a bridge between wings)min_height=4

The definitions follow the OpenStreetMap wiki (Key:height, Key:building:levels). Buildings made of parts with different heights are mapped as building:part, each part with its own height.

How that becomes the height in the game

OpenMapTiles vector tiles carry a render_height value for every building. It is computed like this:

  1. if the building has height, that is used (rounded up to whole meters);
  2. otherwise building:levels × 3.66 m;
  3. if both are missing, the building is 5 m tall.

The bottom edge, render_min_height, is derived the same way from min_height or building:min_level. City Defense uses these values as they are and doesn't fill gaps from other sources – not even national cadastres. The game should work the same way in every country, and a single source of heights guarantees that.

What a building's height affects in the game

So a building without height data becomes a low, 5-meter, two-story house in the game, however tall it really is: a tower on it has short range, the building has few hit points and leaves little rubble.

How to fix a height in OpenStreetMap

  1. Create an account at openstreetmap.org.
  2. Find the building, zoom in and click “Edit” – the iD editor opens.
  3. Select the building and add building:levels (count the above-ground floors from the street), and roof:levels if there are attic floors. Only enter an exact height if you really know it.
  4. Save the change with a short comment, such as “added number of levels from local knowledge”.

Only add what you know. OpenStreetMap relies on local knowledge and permitted sources – copying from Google Maps or other licensed maps is not allowed. Millions of people use the map, so accuracy matters more than speed.

You'll see the change on openstreetmap.org right away. It reaches the OpenFreeMap map tiles – and with them City Defense – with their next update.

Frequently asked questions

Does OpenStreetMap have building heights?

Yes, but not for every building. Height is stored in the height tag or derived from the number of floors, building:levels. Where both are missing, OpenMapTiles map tiles assume 5 m.

Should I add height or building:levels?

You can count floors reliably from the street, so building:levels is usually the better choice. Only enter an exact height if you really know it.

When will my fix show up in the game?

On openstreetmap.org, immediately. It reaches the game once OpenFreeMap publishes new tiles – the game always uses its current tiles and stores nothing.