[postgis-users] count points of a geometry

Obe, Regina robe.dnd at cityofboston.gov
Wed May 16 09:16:18 PDT 2007


I think npoints might do the trick

select sum(npoints(the_geom)) from table; 

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Stefan Zweig
Sent: Wednesday, May 16, 2007 11:45 AM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] count points of a geometry

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

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.



More information about the postgis-users mailing list