|
268 | 268 | <title>
|
269 | 269 | Polygon
|
270 | 270 | </title>
|
| 271 | + |
271 | 272 | <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"/>). |
273 | 278 | </para>
|
274 |
| - <funcsynopsis> |
275 |
| - <funcprototype> |
276 |
| - <funcdef><function>spoly</function></funcdef> |
277 |
| - <paramdef>spoint <parameter>edge</parameter></paramdef> |
278 |
| - </funcprototype> |
279 |
| - </funcsynopsis> |
| 279 | + |
280 | 280 | <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> |
286 | 286 | </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 | + |
287 | 310 | <example>
|
288 | 311 | <title>
|
289 | 312 | Create a spherical polygon using a set of spherical points
|
|
0 commit comments