[postgis-users] geometryN() pointN() interiorRingN() - 0 or 1 based indexing

David Blasby dblasby at refractions.net
Fri Aug 8 09:56:05 PDT 2003


PostGIS (and I believe JTS and GEOS) all use 0-based numbering for these 
functions.  So, pointN(<linestring>, 0) is the 1st point, and 
pointN(<linestring>, 1) is the second point.

s2.1.6.1 of the spec says:

PointN(N:Integer):Point—Returns the specified point N in this Linestring.

The documentation of the rest of the ...N() functions are equally useless.

I noticed in the example SF SQL conformance test that they show the 
results of pointN(<linestring>,1) being the 1st point in the linestring 
(not the 2nd).

I would like to change postgis so its conformant on this issue (1=first 
point), but I wanted to get some feedback first.  Is this going to cause 
anyone hardship?

dave




More information about the postgis-users mailing list