diff --git a/capi/geos_c.h.in b/capi/geos_c.h.in index 271624334..37502912c 100644 --- a/capi/geos_c.h.in +++ b/capi/geos_c.h.in @@ -2580,6 +2580,8 @@ extern void GEOS_DLL *GEOSGeom_getUserData(const GEOSGeometry* g); * multi-geometry or collection or 1 for a simple geometry. * For nested collections, remember to check if returned * sub-geometries are **themselves** also collections. +* Empty collection or multi-geometry types return 0, +* and empty simple geometry types return 1. * \param g Input geometry * \return Number of direct children in this collection * \warning For GEOS < 3.2 this function may crash when fed simple geometries diff --git a/include/geos/geom/Geometry.h b/include/geos/geom/Geometry.h index 38343cee2..cfa989a9a 100644 --- a/include/geos/geom/Geometry.h +++ b/include/geos/geom/Geometry.h @@ -302,8 +302,13 @@ class GEOS_DLL Geometry { /// Return an integer representation of this Geometry type virtual GeometryTypeId getGeometryTypeId() const = 0; //Abstract - /// Returns the number of geometries in this collection - /// (or 1 if this is not a collection) + /** + * \brief Returns the number of geometries in this collection, + * or 1 if this is not a collection. + * + * Empty collection or multi-geometry types return 0, + * and empty simple geometry types return 1. + */ virtual std::size_t getNumGeometries() const {