10000 Add spoly(spoint[]) constructor function by vitcpp · Pull Request #99 · postgrespro/pgsphere · GitHub
[go: up one dir, main page]

Skip to content

Add spoly(spoint[]) constructor function #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update the doc with spoly, spoly_deg function descriptions
  • Loading branch information
vitcpp committed Nov 3, 2023
commit 4d8e97dfbd5f65c424a92c19e87a1a57f9c1bcc9
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