[postgis-users] ST_NPoints from polygons

Etienne B. Racine etiennebr at gmail.com
Mon Jul 1 04:45:44 PDT 2019


Hi list,

I'm implementing postgis compatible functions for R, so I wanted to make
sure I had the right behavior. I wanted to check that the behavior of
ST_NPoints was consistent with expectations.
SELECT ST_NPoints('POLYGON((0 0, 1 1, 2 0, 0 0))'::geometry);
#>  st_npoints
#> ------------
#>           4
I would have expected that the repeated vertex wouldn't be counted (a
triangle would have 3 vertices). The doc (*Return the number of points in a
geometry*) seems to imply that the behavior is correct though, since a
point isn't necessarly a vertex; but it still leaves room to interpretation.

Etienne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20190701/0db6bb49/attachment.html>


More information about the postgis-users mailing list