# Common - Inside Polygon

## Location Inside Poly

<mark style="color:green;">`POST`</mark> `/api/common`

Returns results on if a location is inside a polygon or not. Recommended to use for high-level checking.

This specific endpoint does not auto-scale geohash precision, ensure your initial polygon points have precision or use another endpoint.

**Body**

| Param     | Value/Type | Description  |
| --------- | ---------- | ------------ |
| function  | 'inside'   | Static       |
| points    | array      |              |
| precision | int        | Default is 6 |
| locations | array      |              |

**Example**

{% tabs %}
{% tab title="Input" %}

```json
{
  .. other params
  "points": [
    [float, float],
    [float, float],
    [float, float],
    [float, float],
    ...
  ],
  "locations": [
    {
      "latitude": float,
      "longitude": float
    }
    ...
  ]
}
```

{% endtab %}
{% endtabs %}

**Response**

{% tabs %}
{% tab title="200" %}

```json
[
  {
    "latitude": float,
    "longitude": float,
    "is_inside": bool
  }
  ...
]
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Error Message Here"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://docs.systemsx.co.uk/geo/common-inside-polygon.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
