12.07.2015 Views

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>PostGIS</strong> <strong>1.5.8</strong> <strong>Manual</strong>127 / 310--If can’t be merged - original MULTILINESTRING is returnedSELECT ST_AsText(ST_LineMerge(ST_GeomFromText(’MULTILINESTRING((-29 -27,-30 -29.7,-36 -31,-45 -33),(-45.2 -33.2,-46 -32)) ←↪’)));st_astext----------------MULTILINESTRING((-45.2 -33.2,-46 -32),(-29 -27,-30 -29.7,-36 -31,-45 -33))See AlsoST_Segmentize, ST_Line_Substring7.5.11 ST_CollectionExtractST_CollectionExtract — Given a GEOMETRYCOLLECTION, returns a MULTI* geometry consisting only of the specifiedtype. Sub-geometries that are not the specified type are ignored. If there are no sub-geometries of the right type, an EMPTYcollection will be returned. Only points, lines and polygons are supported. Type numbers are 1 == POINT, 2 == LINESTRING,3 == POLYGON.Synopsisgeometry ST_CollectionExtract(geometry collection, integer type);DescriptionGiven a GEOMETRYCOLLECTION, returns a MULTI* geometry consisting only of the specified type. Sub-geometries thatare not the specified type are ignored. If there are no sub-geometries of the right type, an EMPTY collection will be returned.Only points, lines and polygons are supported. Type numbers are 1 == POINT, 2 == LINESTRING, 3 == POLYGON.Availability: 1.5.0Examples-- Constants: 1 == POINT, 2 == LINESTRING, 3 == POLYGONSELECT ST_AsText(ST_CollectionExtract(ST_GeomFromText(’GEOMETRYCOLLECTION( ←↪GEOMETRYCOLLECTION(POINT(0 0)))’),1));st_astext---------------MULTIPOINT(0 0)(1 row)SELECT ST_AsText(ST_CollectionExtract(ST_GeomFromText(’GEOMETRYCOLLECTION( ←↪GEOMETRYCOLLECTION(LINESTRING(0 0, 1 1)),LINESTRING(2 2, 3 3))’),2));st_astext---------------MULTILINESTRING((0 0, 1 1), (2 2, 3 3))(1 row)See AlsoST_Multi

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!