From: Regina Obe Date: Thu, 16 Oct 2008 18:35:35 +0000 (+0000) Subject: Move over ST_NumGeometries X-Git-Tag: 1.4.0b1~609 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=af28063e7cad5bc13c55a21d0bfb50ccd9ffc63f;p=postgis Move over ST_NumGeometries git-svn-id: http://svn.osgeo.org/postgis/trunk@3128 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference.xml b/doc/reference.xml index 02502ab4b..057fbc330 100644 --- a/doc/reference.xml +++ b/doc/reference.xml @@ -179,16 +179,7 @@ - - ST_NumGeometries(geometry) - - - If geometry is a GEOMETRYCOLLECTION (or MULTI*) return the - number of geometries, otherwise return NULL. - - - - + ST_GeometryN(geometry,nth integer) @@ -203,16 +194,6 @@ - - ST_NumPoints(geometry) - - - Find and return the number of points in the first linestring - in the geometry. Return NULL if there is no linestring in the - geometry. - - - ST_PointN(geometry,nth integer) @@ -1608,17 +1589,6 @@ WHERE n*100.00/length < 1; - - ST_NumGeometries - - - Return the number of geometries in an - ST_GeomCollection. - - SQL-MM 3: 9.1.4 - - - ST_Point diff --git a/doc/reference_new.xml b/doc/reference_new.xml index 93c96606d..f43bf8a03 100644 --- a/doc/reference_new.xml +++ b/doc/reference_new.xml @@ -2358,6 +2358,60 @@ NOTICE: Self-intersection at or near point 0 0 + + + ST_NumGeometries + If geometry is a GEOMETRYCOLLECTION (or MULTI*) return the + number of geometries, otherwise return NULL. + + + + + + integer ST_NumGeometries + geometry a_multi_or_geomcollection + + + + + + Description + + Returns 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.4 + + + + + Examples + + +--Although ST_NumGeometries will return null when passed a single, you can wrap in ST_Multi to force 1 or more for all geoms +SELECT ST_NumGeometries(ST_Multi(ST_GeomFromText('LINESTRING(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07)'))); +--result +1 + +--Geometry Collection Example - multis count as one geom in a collection +SELECT 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)))')); +--result +3 + + + + See Also + + , + + + ST_NumInteriorRings