<div dir="auto">Yes, that is correct.  <div dir="auto"><br></div><div dir="auto">As per the Simple Features for SQL standard, Linear Rings include a closing point which is equal to the start point, and all points are included in the count.  Polygons are made up of rings, so inherit this behaviour.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 1, 2019, 4:46 AM Etienne B. Racine <<a href="mailto:etiennebr@gmail.com">etiennebr@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div><br></div><div>Hi list, <br></div><div><br></div><div>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.</div><div><span style="font-family:courier new,monospace">SELECT ST_NPoints('POLYGON((0 0, 1 1, 2 0, 0 0))'::geometry);<br>#>  st_npoints <br>#> ------------<br>#>           4</span></div><div>I would have expected that the repeated vertex wouldn't be counted (a triangle would have 3 vertices). The doc (<i>Return the number of points in a geometry</i>) seems to imply that the behavior is correct though, since a point isn't necessarly a vertex; but it still leaves room to interpretation.<br></div><div><br></div><div>Etienne<br></div><div><br></div></div></div>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank" rel="noreferrer">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a></blockquote></div>