Skip to content

Commit 4d8e97d

Browse files
committed
Update the doc with spoly, spoly_deg function descriptions
1 parent 595ecc9 commit 4d8e97d

File tree

1 file changed

+35
-12
lines changed

1 file changed

+35
-12
lines changed

Diff for: doc/constructors.sgm

+35-12
Original file line numberDiff line numberDiff line change
@@ -268,22 +268,45 @@
268268
<title>
269269
Polygon
270270
</title>
271+
271272
<para>
272-
The aggregate function
273+
The functions <literal>spoly</literal> and <literal>spoly_deg</literal>
274+
can be used to create spherical polygons. Function <literal>spoly</literal>
275+
is overloaded and can accept arrays of float8 or spoint elements.
276+
There are the same restrictions as for using the input function of
277+
spherical polygon (see <xref linkend="dt.spoly"/>).
273278
</para>
274-
<funcsynopsis>
275-
<funcprototype>
276-
<funcdef><function>spoly</function></funcdef>
277-
<paramdef>spoint <parameter>edge</parameter></paramdef>
278-
</funcprototype>
279-
</funcsynopsis>
279+
280280
<para>
281-
can be used to create a polygon from a set of spherical points.
282-
There are the same restrictions as for using the input function of
283-
spherical polygon (see <xref linkend="dt.spoly"/>). The function
284-
returns
285-
<literal>NULL</literal>, if the polygon couldn't be created.
281+
Create a spherical polygon from an array of pair-consecutive
282+
numbers (lng, lat). The coordinates are specified in radians.
283+
<programlisting>
284+
<![CDATA[sql> SELECT spoly(ARRAY[0, 0, 0, 0.5, 0.5, 0.5, 0.5, 0])]]>
285+
</programlisting>
286286
</para>
287+
288+
<para>
289+
Create a spherical polygon from an array of spoint elements.
290+
<programlisting>
291+
<![CDATA[sql> SELECT spoly(ARRAY[spoint(0, 0), spoint(0, 0.5), spoint(0.5, 0.5), spoint(0.5, 0)])]]>
292+
</programlisting>
293+
</para>
294+
295+
<para>
296+
Create a spherical polygon from an array of pair-consecutive
297+
numbers (lng, lat). The coordinates are specified in degrees.
298+
<programlisting>
299+
<![CDATA[sql> SELECT spoly_deg(ARRAY[0, 0, 0, 10, 10, 10, 10, 0])]]>
300+
</programlisting>
301+
</para>
302+
303+
<para>
304+
The aggregate function <literal>spoly</literal> can be used to
305+
create a polygon from a set of spherical points. The function
306+
returns <literal>NULL</literal>, if the polygon could not be
307+
created.
308+
</para>
309+
287310
<example>
288311
<title>
289312
Create a spherical polygon using a set of spherical points

0 commit comments

Comments
 (0)