Socrata was acquired by Tyler Technologies in 2018 and is now the Data and Insights division of Tyler. The platform is still powered by the same software formerly known as Socrata but you will see references to Data & Insights going forward.

centroid

Function: centroid
  returns the geometric centroid of a polygon or multipolygon. Please refer to
  https://docs.rs/geo/0.10.0/geo/algorithm/centroid/index.html for more
  information.

Examples:

  centroid(to_multipolygon('MULTIPOLYGON (((0.0 0.0, 10.0 0.0, 10.0 10.0, 0.0 10.0, 0.0 0.0)))'))
  -- Result: {"type":"Point","coordinates":[5.0,5.0]}

  centroid(to_polygon('POLYGON ((0.0 0.0, 10.0 0.0, 10.0 10.0, 0.0 10.0, 0.0 0.0))'))
  -- Result: {"type":"Point","coordinates":[5.0,5.0]}

  centroid(to_multipolygon(null))
  -- Result: null

  centroid(to_multipolygon('MULTIPOLYGON(((0.0 0.0, 1.0, 0.0 0.0)))'))
  -- Result: {"type":"type_conversion_failed","english":"Unable to convert \"MULTIPOLYGON(((0.0 0.0, 1.0, 0.0 0.0)))\" from text to multipolygon","data":{"value":"MULTIPOLYGON(((0.0 0.0, 1.0, 0.0 0.0)))","target_type":"multipolygon","source_type":"text"}}




Signatures
p -> point