[postgis-devel] ST_NumPoints vs ST_NPoints

Paul Ramsey pramsey at cleverelephant.ca
Fri Jul 18 07:33:08 PDT 2008


numpoints is an OGC and npoints is a PostGIS, but...

numpoints being an OGC means that people might look/notice it first
and think they have to do:
sum(st_numpoints(st_geometryn(geom,generate_series(1,st_numgeometries(geom)))))
instead of just st_npoints(geom)

I'd rather make numpoints as useful as npoints...

P.

On Fri, Jul 18, 2008 at 5:14 AM, Obe, Regina <robe.dnd at cityofboston.gov> wrote:
> Isn't ST_NumPoints an OGC defined spec item and ST_NPoints is a postgis
> creation.
>
> If you are binding internally to ST_NPoints I think that is okay, but I
> think ST_NumPoints should then do a validation check to make sure a line
> string is passed to it, or is that not required by the specs.  I
> consider it along the same lines as the same sillyness with
> ST_PolyFromtext, ST_PointFromText etc.  Those do validation checksand
> just map to GeomFromText
>
> I'm moving those functions to the new section now by the way.  So let me
> know any thing you want me to add.
>
> -----Original Message-----
> From: postgis-devel-bounces at postgis.refractions.net
> [mailto:postgis-devel-bounces at postgis.refractions.net] On Behalf Of Paul
> Ramsey
> Sent: Thursday, July 17, 2008 3:42 PM
> To: PostGIS Development Discussion
> Subject: [postgis-devel] ST_NumPoints vs ST_NPoints
>
> Why would I ever use ST_NumPoints, which fails if handed anything but
> a linestring or circular string? It has no merits, it just requires
> more work to use... if I want the number of vertices in a polygon, I
> can either just use npoints, or I can carefully deconstruct the thing
> into rings before using numpoints.  I think we should bind numpoints
> to the npoints backend function and call it a day.
>
> P.
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
> -----------------------------------------
> 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.
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>



More information about the postgis-devel mailing list