| | 608 | <refentry id="ST_CollectionExtract"> |
| | 609 | <refnamediv> |
| | 610 | <refname>ST_CollectionExtract</refname> |
| | 611 | |
| | 612 | <refpurpose>Given a GEOMETRYCOLLECTION, returns the a MULTI* geometry consisting only the specified type. Sub-geometries that are not |
| | 613 | the specified type are ignored.</refpurpose> |
| | 614 | </refnamediv> |
| | 615 | |
| | 616 | <refsynopsisdiv> |
| | 617 | <funcsynopsis> |
| | 618 | <funcprototype> |
| | 619 | <funcdef>geometry <function>ST_CollectionExtract</function></funcdef> |
| | 620 | <paramdef><type>geometry </type> <parameter>collection</parameter></paramdef> |
| | 621 | <paramdef><type>integer </type> <parameter>type</parameter></paramdef> |
| | 622 | </funcprototype> |
| | 623 | </funcsynopsis> |
| | 624 | </refsynopsisdiv> |
| | 625 | |
| | 626 | <refsection> |
| | 627 | <title>Description</title> |
| | 628 | |
| | 629 | <para>Given a GEOMETRYCOLLECTION, returns the a MULTI* geometry consisting only the specified type. Sub-geometries that are not |
| | 630 | the specified type are ignored. If there are no sub-geometries of the right type, an EMPTY collection will be returned. Only |
| | 631 | points, lines and polygons are supported.</para> |
| | 632 | |
| | 633 | </refsection> |
| | 634 | |
| | 635 | <refsection> |
| | 636 | <title>Examples</title> |
| | 637 | |
| | 638 | <programlisting>SELECT ST_AsText(ST_CollectionExtract(ST_GeomFromText('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(0 0)))'),1)); |
| | 639 | st_astext |
| | 640 | --------------- |
| | 641 | MULTIPOINT(0 0) |
| | 642 | (1 row) |
| | 643 | </programlisting> |
| | 644 | </refsection> |
| | 645 | <refsection> |
| | 646 | <title>See Also</title> |
| | 647 | <para><xref linkend="ST_Multi" /></para> |
| | 648 | </refsection> |
| | 649 | </refentry> |
| | 650 | |