Skip to main content
Skip to main content

Geometric

ClickHouse supports data types for representing geographical objects — locations, lands, etc.

See Also

Point​

Point is represented by its X and Y coordinates, stored as a Tuple(Float64, Float64).

Example

Query:

Result:

Ring​

Ring is a simple polygon without holes stored as an array of points: Array(Point).

Example

Query:

Result:

LineString​

LineString is a line stored as an array of points: Array(Point).

Example

Query:

Result:

MultiLineString​

MultiLineString is multiple lines stored as an array of LineString: Array(LineString).

Example

Query:

Result:

Polygon​

Polygon is a polygon with holes stored as an array of rings: Array(Ring). First element of outer array is the outer shape of polygon and all the following elements are holes.

Example

This is a polygon with one hole:

Result:

MultiPolygon​

MultiPolygon consists of multiple polygons and is stored as an array of polygons: Array(Polygon).

Example

This multipolygon consists of two separate polygons — the first one without holes, and the second with one hole:

Result: