[geos-devel] Zero-based indexing

David Blasby dblasby at refractions.net
Thu Apr 10 13:29:36 EDT 2003

I've noticed that JTS (and GEOS) uses 0-based indexing.  I.e. 
getGeometryN(), pointN(), getInteriorRingN() - the first "thing" is 0.
PostGIS also follows this convention.

Unfortunately, the OGC SF SQL conformance test uses 1-based indexing. 
 pointN(1) is the first point.

I looked in the SF SQL specification, and it doesnt specify which to 
use.  Does anyone have a reference to say that 0-based indexing is 
correct?  The conformance test is filled with errors so I dont trust it.

ps. yes, this means that we are getting close to having postgis pass the 
conformance tests.

More information about the geos-devel mailing list