Skip to main content
The polygon (POLYGON) dictionary is optimized for point-in-polygon queries, essentially “reverse geocoding” lookups. Given a coordinate (latitude/longitude), it efficiently finds which polygon/region (from a set of many polygons, such as country or region boundaries) contains that point. It’s well-suited for mapping location coordinates to their containing region.
Example of configuring a polygon dictionary:
If you are using a dictionary with ClickHouse Cloud please use the DDL query option to create your dictionaries, and create your dictionary as user default. Also, verify the list of supported dictionary sources in the Cloud Compatibility guide.

When configuring the polygon dictionary, the key must have one of two types:
  • A simple polygon. It is an array of points.
  • MultiPolygon. It is an array of polygons. Each polygon is a two-dimensional array of points. The first element of this array is the outer boundary of the polygon, and subsequent elements specify areas to be excluded from it.
Points can be specified as an array or a tuple of their coordinates. In the current implementation, only two-dimensional points are supported. The user can upload their own data in all formats supported by ClickHouse. There are 3 types of in-memory storage available: Dictionary queries are carried out using standard functions for working with dictionaries. An important difference is that here the keys will be the points for which you want to find the polygon containing them. Example Example of working with the dictionary defined above:
As a result of executing the last command for each point in the ‘points’ table, a minimum area polygon containing this point will be found, and the requested attributes will be output. Example You can read columns from polygon dictionaries via SELECT query, just turn on the store_polygon_key_column = 1 in the dictionary configuration or corresponding DDL-query.
Query
Response
Last modified on June 19, 2026