Quickstart
Cityweft API is designed to be user-friendly and provides a single endpoint to retrieve comprehensive 3D urban data.
Retrieve geometry
POST
https://api.cityweft.com/v1/context
Headers
Content-Type
application/json
Authorization
Bearer <token>
Body
The polygon
is the only required parameter in this API request.
Make sure to include it in the body to successfully retrieve the geometry
polygon
array of coordinates [lat,lon][]
Represents the user's area on the map
Yes
origin
coortinate [lat,lon]
Optional if you want to directly set the origin
No
Example API Request
Here is an example of a complete API request to retrieve a model in London using the polygon
parameter:
{
"polygon": [
[51.5074, -0.1278],
[51.5075, -0.1279],
[51.5076, -0.1280],
[51.5074, -0.1278]
],
"settings": {
// Optional settings here, more info in "Customizations" section
defaultRoofType: 'flat'
defaultLevels: 2,
defaultLevelHeight: 4,
topographyModel: false,
geometry: ["buildings", "surface"]
}
}
Response Example
The response includes:
geometry
: An array containing different geometric elements. The currently supportedgeometryType
values aremeshes
,elevationMaps
, andnodes
. Each geometry type is associated with specific data fields and descriptors detailing its characteristics.spacialReference
: Depends on the selected CRS. More info at Coordinate Systems (CRS)
Cropping Scene
We provide an optional parameter to slice the model according to a polygon. By default, the returned geometry includes everything within the polygon and some extra geometry that may extend beyond its boundaries. Using the cropScene
parameter, you can obtain a perfectly sliced model that matches your polygon precisely.

Types of geometry
{
"origin": [lat, lng], // origin point
"geometry": [
{
"type": "buildings",
"geometryType": "meshes",
"meshes": [{
"vertices": [x1, y1, z1, x2, y2, z2, ...], // 3 components per vertex
}, ...]
},
{
"type": "surface",
"geometryType": "meshes",
"meshes": [{
"vertices": [x1, y1, z1, x2, y2, z2, ...],
}, ...]
},
{
"type": "barriers",
"geometryType": "meshes",
"meshes": [{
"vertices": [x1, y1, z1, x2, y2, z2, ...],
}, ...]
},
// if 'topographyReturnType' is 'elevationMap'
{
"type": "",
"geometryType": "elevationMaps",
"elevationMaps": [{
"info": {
"terrainSize": 392.3526603589423,
"segmentsCount": 256,
"position": {
"x": 434.17214010119096,
"y": -93.82671476012737
},
"elevationMap": [
245.6110076904297,
245.7227783203125,
245.7227783203125,
246.12277221679688,
247.12277221679688,
248.32278442382812,
...
]
}
}]
}
]
}
⚠ When working with 3D visualization libraries, you may need to transform the coordinates to match your rendering engine's coordinate system. For example, some engines use Y-up instead of Z-up.
Last updated