> For the complete documentation index, see [llms.txt](https://docs.carto.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.carto.com/data-and-analysis/analytics-toolbox-for-snowflake/sql-reference/measurements.md).

# measurements

This module contains functions that compute measurements of distance, area and angles. There are also functions to compute geometry values determined by measurements.

## ST\_MINKOWSKIDISTANCE <a href="#st_minkowskidistance" id="st_minkowskidistance"></a>

```sql
ST_MINKOWSKIDISTANCE(geog [, p])
```

**Description**

Calculate the Minkowski p-norm distance between two features.

**Input parameters**

* `geojsons`: `ARRAY` array of features in GeoJSON format casted to STRING.
* `p` (optional): `FLOAT64` minkowski p-norm distance parameter. 1: Manhattan distance. 2: Euclidean distance. 1 =< p <= infinity. By default `p` is `2`.

**Return type**

`ARRAY`

**Examples**

```sql
SELECT CARTO.CARTO.ST_MINKOWSKIDISTANCE(
  ARRAY_CONSTRUCT(
    ST_ASGEOJSON(ST_POINT(10,10))::STRING,
    ST_ASGEOJSON(ST_POINT(13,10))::STRING
  )
);
-- [ [ 0, 3.333333333333333e-01 ], [ 3.333333333333333e-01, 0 ] ]
```

```sql
SELECT CARTO.CARTO.ST_MINKOWSKIDISTANCE(
  ARRAY_CONSTRUCT(
    ST_ASGEOJSON(ST_POINT(10,10))::STRING,
    ST_ASGEOJSON(ST_POINT(13,10))::STRING
  ),
  2
);
-- [ [ 0, 3.333333333333333e-01 ], [ 3.333333333333333e-01, 0 ] ]
```

{% hint style="info" %}
**Additional examples**

* [Minkowski distance to perform cannibalization analysis](https://academy.carto.com/advanced-spatial-analytics/spatial-analytics-for-snowflake/step-by-step-tutorials/minkowski-distance-to-perform-cannibalization-analysis)
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.carto.com/data-and-analysis/analytics-toolbox-for-snowflake/sql-reference/measurements.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
