> For the complete documentation index, see [llms.txt](https://cityweft.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cityweft.gitbook.io/docs/geometry/buildings.md).

# Buildings

Buildings are the main geometry type in Cityweft API. Meshes contains an array of meshes representing the building or its parts, which may include roofs.

Geometry Type: <mark style="color:blue;">`meshes`</mark>

```javascript
{
     "type": "buildings",
     "geometryType": "meshes",
     "meshes": Mesh[]
},
```

What does a Mesh element contain? This is the example:

```javascript
{
     // The most important element of any meshed geometry for visualization
     "vertices": [x1, y1, z1, x2, y2, z2, ...],
     // Metadata about the building — type, dimensions, roof, materials, data tier
     "descriptor": {
          "type": "building",
          "datasetName": "Global Buildings - Mapped",
          "buildingHeight": 12.5,
          "heightBasis": "measured",
          ...
     }
},
```

The full descriptor reference lives at [Metadata (Descriptors)](/docs/basics/metadata-descriptors.md).

{% hint style="info" %}
By default meshes are non-indexed triangle soup. Set `settings.indexedMeshes: true` to receive welded vertices plus an `indices` array per mesh — significantly smaller payloads. More info: [Customizations](/docs/basics/customizations.md)
{% endhint %}

### Data quality tiers

Cityweft combines worldwide base data with premium country datasets that carry measured heights and detailed roof shapes — every request automatically uses the best building data available to your account. Each mesh's `descriptor.datasetName` identifies its tier (`Global Buildings - Mapped`, `Europe Buildings - Measured`, `Premium <Country> Buildings - Detailed`, …), and `heightBasis` tells you whether the height was measured, mapped, derived, or estimated.

More detail: [Customizations](/docs/basics/customizations.md)

\
An example of how to render meshed geometry in Three.js (more info: [Three.js Quick Guide](/docs/getting-started/three-quick-guide.md))

```javascript
const geometry = new THREE.BufferGeometry();
const verticesArray = new Float32Array(mesh.vertices);
geometry.setAttribute( 'position', new THREE.BufferAttribute( verticesArray, 3 ) );
if (mesh.indices) geometry.setIndex(mesh.indices); // when settings.indexedMeshes is true
geometry.computeVertexNormals();
```

<figure><img src="https://2449447963-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2ahel6HN9zgEzJ1vY9kr%2Fuploads%2FWnpQUEMYAz49ccTiyTRL%2Fscene-1748950382675%20(1).png?alt=media&#x26;token=8875b982-e68e-4fcd-8092-941fed65eb05" alt=""><figcaption><p>Different colours for different data tiers</p></figcaption></figure>
