convex_hull(...)

convex_hull(...)

Returns the minimum convex geometry that encloses all of the geometries within a set

Works with the following datatypes:

This function works with 2.1 endpoint(s). What does this mean? »

The convex_hull(...) generates a polygon that represents the minimum convex geometry that can encompass a set of points or geometries. All of the points in the set will either represent vertexes of that polygon, or will be enclosed within it, much like if you were to take a rubber band and snap it around the set of points. The below image from Wikipedia may help explain better:

For example, to get the convex hull that surrounds all of the crimes in Chicago in 2014:

https://data.cityofchicago.org/resource/6zsd-86xi.geojson?\$select=count(*),convex_hull(location)&year=2014

This can be very useful in generating heat maps or to describe the geographic area affected by a given dataset.