Polygon Datatype

The Polygon datatype represents a shape on the Earth as a ring of WGS84 Latitude and Longitude pairs. The location is encoded as a GeoJSON “polygon”. Example:

{
  "type": "Polygon",
  "coordinates": [
    [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]
  ]
}
Heads up! Contrary to the normal convention of "latitude, longitude" ordering in the coordinates property, GeoJSON orders the coordinates as "longitude, latitude" (X coordinate, Y coordinate), as other GIS coordiate systems are encoded. Note that the SoQL within_box and within_circle functions use the more conventional ordering, however.

The following table describes the functions that can be used with Polygon .

Function Name Description Availability
case(...) Returns different values based on the evaluation of boolean comparisons 2.1
convex_hull(...) Returns the minimum convex geometry that encloses all of the geometries within a set 2.1
extent(...) Returns a bounding box that encloses a set of geometries 2.1
intersects(...) Allows you to compare two geospatial types to see if they intersect or overlap each other 2.1
within_box(...) Returns the rows that have geodata within the specified box, defined by latitude, longitude corners 2.0 and 2.1
within_circle(...) Returns the rows that have locations within a specified circle, measured in meters 2.0 and 2.1
within_polygon(...) Returns the rows that have locations within the specified box, defined by latitude, longitude corners 2.1