[postgis-users] count points of a geometry

Stefan Zweig stefanzweig1881 at web.de
Wed May 16 08:45:28 PDT 2007


hi list,

i am looking for good way to count all points as a sum of all the points which are in all rows of a "the_geom"-column. geometrytype can be of the type polygon, polyline, multipolygon or multiline.

i am thinking of something like

select sum (NumPoints("the_geom")) FROM table WHERE  true;

The Documentation of PostGIS says that NumPoints(geometry) only retrieves  the number of points of the first linestring within a geometry, so that would not be sufficient for my case.

["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."]

Has anybody an idea how i can get the result?


Thanks in advance,

stefan
_______________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192




More information about the postgis-users mailing list