# GEOGRAPHY\_CONTAINS

This function takes in two geospatial objects and determines whether the first one completely covers the area of the second.

![](https://images.contentstack.io/v3/assets/bltac01ee6daa3a1e14/blt60f83342566cd71f/6a2c42f77b02a41ad86455bd/contains-NJhMmZ.png)

## Syntax

```
GEOGRAPHY_CONTAINS ( geo1, geo2 )

```

## Arguments

* geo1, geo2: any valid geospatial object or WKT string: path, point or polygon.

## Return Type

Boolean

## Remarks

When specifying a polygon, it must be smaller than one half of the Earth. When defining a polygon, the area inside the polygon is the "smaller" portion of the globe. For example, if you define a polygon that outlines the shape of Australia, there could be two possible sides: All of the globe except Australia, or Australia itself. Because the side with the smaller area is Australia, that is what is considered inside the polygon.

## Examples

```sql
CREATE ROWSTORE TABLE neighborhoods (
  id INT UNSIGNED NOT NULL PRIMARY KEY,
  name VARCHAR(64) NOT NULL,
  population INT UNSIGNED NOT NULL,
  shape GEOGRAPHY NOT NULL,
  centroid GEOGRAPHYPOINT NOT NULL,
  index (shape) WITH (resolution = 8),
  index (centroid)
  );

  INSERT INTO neighborhoods VALUES
  (1, "Hamilton", 12346, "POLYGON((1 1,2 1,2 2, 1 2, 1 1))","POINT(1.5 1.5)"),
  (2, "Probability Bay", 263951, "POLYGON((5 1,6 1,6 2,5 2,5 1))", "POINT(5.5 1.5)"),
  (3, "Decentralized Park", 29265, "POLYGON((5 5,6 5,6 6,5 6,5 5))", "POINT(5.5 5.5)"),
  (4, "Axiom Township", 845696, "POLYGON((1 5,2 5,2 6,1 6,1 5))", "POINT(1.5 5.5)"),
  (5, "Elegant Island ", 987654, "POLYGON((3 3,4 3,4 4,3 4,3 3))", "POINT(3.5 3.5)");
```

```sql
SELECT id, name FROM neighborhoods
WHERE
  GEOGRAPHY_CONTAINS(shape, "POLYGON((3 3,4 3,4 4,3 4,3 3))");

```

## Related Topics

For more information about working with geospatial data, see [Working with Geospatial Features](https://docs.singlestore.com/db/v9.1/developer-resources/functional-extensions/working-with-geospatial-features.md).

***

Modified at: April 5, 2024

Source: [/db/v9.1/reference/sql-reference/geospatial-functions/geography-contains/](https://docs.singlestore.com/db/v9.1/reference/sql-reference/geospatial-functions/geography-contains/)

(An index of the documentation is available at /llms.txt)
