Yes, that is correct.

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.

On Mon, Jul 1, 2019, 4:46 AM Etienne B. Racine <[email protected]> wrote:

>
> 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
>
> _______________________________________________
> postgis-users mailing list
> [email protected]
> https://lists.osgeo.org/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/postgis-users

Reply via email to