<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/cts.polygon.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>cts.polygon</api:function-name><api:suggest>cts.polygon</api:suggest><api:suggest>cts</api:suggest><api:suggest>polygon</api:suggest><api:function-link mode="xquery" fullname="cts:polygon">/apidoc/8.0/cts:polygon.xml</api:function-link><api:function mode="javascript" name="polygon" type="builtin" lib="cts" category="SearchBuiltins" subcategory="Geospatial Constructors" hidden="false" bucket="MarkLogic Built-In Functions" prefix="cts" namespace="http://marklogic.com/cts" fullname="cts.polygon"><api:summary>
  Returns a geospatial polygon value.
</api:summary><api:params><api:param name="vertices" type="cts:point*"><api:param-description>
    The vertices of the polygon, given in order. No edge may cover
    more than 180 degrees of either latitude or longitude.
    The polygon as a whole may not encompass both
    poles.  These constraints are necessary to ensure an unambiguous
    interpretation of the polygon. There must be at least three vertices.
    The first vertex should be identical to the last vertex to close the
    polygon.
    vertexes.
  </api:param-description><api:param-name>vertices</api:param-name><api:param-type>cts.point[]</api:param-type></api:param></api:params><api:return>cts.polygon</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
// this polygon approximates the 94041 zip code 
var points = [cts.point(0.373899653086420E+02, -0.122078578406509E+03),
    cts.point(0.373765400000000E+02, -0.122063772000000E+03),
    cts.point(0.373781400000000E+02, -0.122067972000000E+03),
    cts.point(0.373825650000000E+02, -0.122068365000000E+03),
    cts.point(0.373797400000000E+02, -0.122072172000000E+03),
    cts.point(0.373899400000000E+02, -0.122092573000000E+03),
    cts.point(0.373941400000000E+02, -0.122095573000000E+03),
    cts.point(0.373966400000000E+02, -0.122094173000000E+03),
    cts.point(0.373958400000000E+02, -0.122092373000000E+03),
    cts.point(0.374004400000000E+02, -0.122091273000000E+03),
    cts.point(0.374004400000000E+02, -0.122091273000000E+03),
    cts.point(0.373873400000000E+02, -0.122057872000000E+03),
    cts.point(0.373873400000000E+02, -0.122057872000000E+03),
    cts.point(0.373854400000000E+02, -0.122052672000000E+03),
    cts.point(0.373833400000000E+02, -0.122053372000000E+03),
    cts.point(0.373819400000000E+02, -0.122057572000000E+03),
    cts.point(0.373775400000000E+02, -0.122060872000000E+03),
    cts.point(0.373765400000000E+02, -0.122063772000000E+03) ];
cts.polygon(points);
</pre></api:example></api:function></api:function-page>