> ## Documentation Index
> Fetch the complete documentation index at: https://docu.truemetrics.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference

> Endpoint, parameters and response contract.

## Endpoint

```
GET https://geodata.truemetrics.cloud/V1/lastmetervisualization
```

Returns a GeoJSON `FeatureCollection` for **one delivery stop**, optionally with a rendered PNG.
The base URL is provided by your truemetrics contact.

## Request

### Query parameters

A request describes a single stop, addressed by up to two address identifiers — the **entrance**
and the **parking**. They may be the **same** identifier (one address that has both) or **two
different** identifiers (many systems store the entrance and parking under separate address ids).
**At least one** of them must be provided.

**identifier\_entrance** `string`

The address identifier (the `id_address` / merge id you send as metadata) used to look up the
**entrance** — and its **building** footprint. Optional, but at least one of
`identifier_entrance` / `identifier_parking` is required.

**identifier\_parking** `string`

The address identifier used to look up the **parking** and the **waypoint** (these two share the
same id). Optional, but at least one of `identifier_entrance` / `identifier_parking` is required.

**raster** `boolean` (default: false)

When `true`, the response also contains a rendered **PNG image** of the geometry in a `raster`
block. Accepted truthy values: `true`, `1`, `yes`, `on`.

**basemap** `boolean` (default: false)

Only relevant together with `raster=true`. When `true`, the PNG is drawn on a **street basemap**;
when `false` the PNG has a **transparent** background so you can overlay it on your own map.

**building** `boolean` (default: true)

Draw the snapped **building footprint** highlight under the entrance. **On by default** — pass
`building=false` to suppress it.

**geojson** `boolean` (default: false)

Include the GeoJSON `features` array in the response. **Off by default** — pass `geojson=true`
to receive the vector geometry. The `type` / `metadata` / `view` envelope (and the `raster`
block, when requested) is always returned, so if you only need the rendered image you can request
`raster=true` alone and keep the payload small.

**reference** `boolean` (default: false)

When `true`, also plot your supplied **reference location** ("taskpoint") as a small red point,
so you can compare the *planned* location against the *detected* entrance. Available for accounts
that send a reference coordinate with their metadata.

### Headers

**x-api-key** `string` *required*

Your API key. Identifies your account; you only receive your own data.

## Response

A standard GeoJSON `FeatureCollection` with two extra top-level blocks, `metadata` and `view`
(and `raster` when requested).

**type** `string`

Always `"FeatureCollection"`.

**features** `array`

The map features — see [Feature types](#feature-types) below. Returned **only when
`geojson=true`** (off by default); otherwise it is an empty array. Even with `geojson=true` it
may be empty when the stop has no data yet (a normal `200`, not an error).

**metadata** `object`

`{ "mode": "default", "system": "EPSG:4326", "waypoint_style": "marker" }` — the coordinate
reference system of all geometry, and how your account draws the waypoint:
`"marker"` (a waypoint point at the end of a solid `waypoint_to_parking` line) or
`"faded"` (no waypoint marker; the `waypoint_to_parking` line fades out toward the
waypoint, see `line_fade`).

**view** `object | null`

A suggested camera fitted to all points: `{ center: { lat, lon }, zoom, orientation,
    position_fixed, zoomable }`. `null` when the collection is empty.

**raster** `object`

Present only when `raster=true` and the collection is non-empty:
`{ image, width, height, bbox, basemap }`, where `image` is a `data:image/png;base64,…`
data-URI, `bbox` is `[minLon, minLat, maxLon, maxLat]`, and `basemap` indicates whether a street
basemap was drawn.

## Feature types

Every feature carries `properties.object_type` (`point` | `line` | `polygon`), the `identifier`
it came from, and styling hints that map directly to map layer styles.

### Point — entrance / parking / waypoint

| Property | Type | Description |
| - | - | - |
| `object_type` | string | `"point"` |
| `point_type` | string | `entrance` · `parking` · `waypoint` · `taskpoint` (your reference location, only with `reference=true`) |
| `color` | string | Marker colour (red entrance, blue parking/waypoint, red taskpoint) → `circle-color` |
| `marker_size` | number | Marker radius → `circle-radius` (the taskpoint is a small dot) |
| `icon` | string | Icon name for the marker (absent for the taskpoint, which is a plain dot) |

### Line — walking path / waypoint leg

Lines are the **stored paths** computed by the truemetrics merge pipeline, routed over real GPS
traces where possible. They can contain many vertices, and a line is only returned once the
pipeline has stored a path for the stop — lines are never computed at request time. `path_source`
tells you how the stored path was derived. Coordinates are ordered source→target (the direction
in `line_type`).

| Property | Type | Description |
| - | - | - |
| `object_type` | string | `"line"` |
| `line_type` | string | `parking_to_entrance` (the dashed walking path) · `waypoint_to_parking` (the approach from the waypoint to the parking) |
| `path_source` | string | `"legs"` — routed over real GPS traces · `"straight"` — the pipeline could not route this pair yet, so the stored path is the direct source→target segment |
| `color` | string | Line colour → `line-color` |
| `line_width` | number | Line width → `line-width` |
| `line_style` | string | `"dashed"` for the walking path; combine with `line_dasharray` (e.g. `[2,2]`) |
| `line_opacity` | number | Opacity of the walking path (e.g. `0.6`) → `line-opacity` |
| `line_fade` / `fade_start` | string / number | Only with `waypoint_style: "faded"`: `waypoint_to_parking` fades toward the waypoint — `line_fade: "to_start"`, transparent at the start of the line, full opacity from `fade_start` (e.g. `0.3`) onward — render with a `line-gradient` |

Paths are raw GPS-routed vertices. Render them with `line-join: "round"` and `line-cap: "round"` for smooth corners; the PNG from `raster=true` already rounds them.

### Polygon — building footprint

| Property | Type | Description |
| - | - | - |
| `object_type` | string | `"polygon"` |
| `point_type` | string | `"building"` |
| `color` | string | Fill / outline colour |
| `fill_opacity` | number | Fill opacity (e.g. `0.2`) → `fill-opacity` |
| `line_width` | number | Outline width |

> [!NOTE]
>
> The entrance and parking can come from **different** identifiers. Pass each to its own parameter
> (`identifier_entrance` / `identifier_parking`) and they are joined into one stop — the dashed
> walking path connects them and, when available, the entrance's building is highlighted.

## Status codes

| Status | Meaning |
| - | - |
| `200` | Success. `features` is empty unless `geojson=true`; with `geojson=true`, an empty `features` array means the stop has no data yet. |
| `400` | Neither `identifier_entrance` nor `identifier_parking` was provided. |
| `403` | Missing or invalid `x-api-key`. |

## Caching & limits

* Successful, non-empty responses are cacheable (`Cache-Control: public, max-age=3600`).
* CORS is open (`Access-Control-Allow-Origin: *`) so the endpoint can be called from the browser.
* Rate limit: **100 requests/second**.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.