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>110 / 310Synopsisinteger ST_NumGeometries(geometry a_multi_or_geomcollection);DescriptionReturns the number of Geometries. If geometry is a GEOMETRYCOLLECTION (or MULTI*) return the number of geometries,otherwise return NULL.This method implements the SQL/MM specification. SQL-MM 3: 9.1.4Examples--Although ST_NumGeometries will return null when passed a single, you can wrap in ST_Multi ←↪to force 1 or more for all geomsSELECT ST_NumGeometries(ST_Multi(ST_GeomFromText(’LINESTRING(77.29 29.07,77.42 29.26,77.27 ←↪29.31,77.29 29.07)’)));--result1--Geometry Collection Example - multis count as one geom in a collectionSELECT ST_NumGeometries(ST_GeomFromEWKT(’GEOMETRYCOLLECTION(MULTIPOINT(-2 3 , -2 2),LINESTRING(5 5 ,10 10),POLYGON((-7 4.2,-7.1 5,-7.1 4.3,-7 4.2)))’));--result3See AlsoST_GeometryN, ST_Multi7.4.22 ST_NumInteriorRingsST_NumInteriorRings — Return the number of interior rings of the first polygon in the geometry. This will work with bothPOLYGON and MULTIPOLYGON types but only looks at the first polygon. Return NULL if there is no polygon in the geometry.Synopsisinteger ST_NumInteriorRings(geometry a_polygon);DescriptionReturn the number of interior rings of the first polygon in the geometry. This will work with both POLYGON and MULTIPOLY-GON types but only looks at the first polygon. Return NULL if there is no polygon in the geometry.This method implements the SQL/MM specification. SQL-MM 3: 8.2.5

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

Saved successfully!

Ooh no, something went wrong!