﻿## Overview

A geometry is an AOI or a POI you use to create a [tasking](https://docs.up42.com/developers/api-tasking) or a [catalog](https://docs.up42.com/developers/api-catalog) order. If you use the same geometry in different orders, you can save geometries in the library and reuse them.

## Add a geometry to the library

To add a new geometry to the library, call the [Create a geometry](https://developer.up42.com/reference/addgeometry?utm_source=documentation) endpoint with your workspace ID as the path parameter.

A valid request body consists of the following parameters:

- `displayName`: The name of the geometry, from 1 to 200 characters.
- `featureCollection`: A GeoJSON [feature collection](https://datatracker.ietf.org/doc/html/rfc7946#section-3.3). Only AOIs are supported.

A sample geometry

```json
{
  "displayName": "Berlin Tiergarten",
  "featureCollection": {
    "type": "FeatureCollection",
    "features": [
      {
        "type": "Feature",
        "geometry": {
          "type": "Polygon",
          "coordinates": [
            [
              [77.259584, 28.622331],
              [77.287879, 28.622632],
              [77.287621, 28.594794],
              [77.259389, 28.594983],
              [77.259584, 28.622331]
            ]
          ]
        }
      }
    ]
  }
}
```

## Retrieve geometries from the library

You can retrieve saved geometries in one of the following ways:

- To get a list of all geometries, call the [Get geometries](https://developer.up42.com/reference/listgeometries?utm_source=documentation) endpoint.
- To get a specific geometry, call the [Get a geometry](https://developer.up42.com/reference/getgeometry?utm_source=documentation) endpoint with the geometry ID as the path parameter.

## Update a geometry in the library

To change the name or the GeoJSON feature collection of a saved geometry, call the [Update a geometry](https://developer.up42.com/reference/patchgeometry?utm_source=documentation) endpoint with the geometry ID as the path parameter.

You can change the values of the `displayName` parameter, the `featureCollection` object, or both.

## Troubleshooting

My geometry isn't valid. How do I fix it? [My geometry isn't valid. How do I fix it? ](https://docs.up42.com#not-valid-geometry "Copy link to this section")

For information on how to create valid geometries, see [Geometry guidelines](https://docs.up42.com/data/rules).
