Skip to content

Commit

Permalink
Update the doc with spoly, spoly_deg function descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
vitcpp committed Nov 3, 2023
1 parent 595ecc9 commit 4d8e97d
Showing 1 changed file with 35 additions and 12 deletions.
47 changes: 35 additions & 12 deletions doc/constructors.sgm
Original file line number Diff line number Diff line change
Expand Up @@ -268,22 +268,45 @@
<title>
Polygon
</title>

<para>
The aggregate function
The functions <literal>spoly</literal> and <literal>spoly_deg</literal>
can be used to create spherical polygons. Function <literal>spoly</literal>
is overloaded and can accept arrays of float8 or spoint elements.
There are the same restrictions as for using the input function of
spherical polygon (see <xref linkend="dt.spoly"/>).
</para>
<funcsynopsis>
<funcprototype>
<funcdef><function>spoly</function></funcdef>
<paramdef>spoint <parameter>edge</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
can be used to create a polygon from a set of spherical points.
There are the same restrictions as for using the input function of
spherical polygon (see <xref linkend="dt.spoly"/>). The function
returns
<literal>NULL</literal>, if the polygon couldn't be created.
Create a spherical polygon from an array of pair-consecutive
numbers (lng, lat). The coordinates are specified in radians.
<programlisting>
<![CDATA[sql> SELECT spoly(ARRAY[0, 0, 0, 0.5, 0.5, 0.5, 0.5, 0])]]>
</programlisting>
</para>

<para>
Create a spherical polygon from an array of spoint elements.
<programlisting>
<![CDATA[sql> SELECT spoly(ARRAY[spoint(0, 0), spoint(0, 0.5), spoint(0.5, 0.5), spoint(0.5, 0)])]]>
</programlisting>
</para>

<para>
Create a spherical polygon from an array of pair-consecutive
numbers (lng, lat). The coordinates are specified in degrees.
<programlisting>
<![CDATA[sql> SELECT spoly_deg(ARRAY[0, 0, 0, 10, 10, 10, 10, 0])]]>
</programlisting>
</para>

<para>
The aggregate function <literal>spoly</literal> can be used to
create a polygon from a set of spherical points. The function
returns <literal>NULL</literal>, if the polygon could not be
created.
</para>

<example>
<title>
Create a spherical polygon using a set of spherical points
Expand Down

0 comments on commit 4d8e97d

Please sign in to comment.