[postgis-users] Migrating PostGis: pointn, geometryn functions

Guido Lemoine guido.lemoine at jrc.it
Fri Aug 26 05:09:16 PDT 2005


Hi all PostGisers,

Being new to the list, let me start by saying that you Refractions guys 
and girls
are all doing a great service to the spatial community...

I've decided to file a few observations that you may want to have a 
closer look
at.

We recently migrated to postgresql 8 and postgis 1.0.3. Most of our
application code is embedded in Java and some in PLPGSQL functions.

During migration, we ran into some "backward compatibility" problems.

One is about the postgis functions that index multi-dimensional 
structures, which
now start at index 1 instead of 0. For example, whereas pre-1.0.x 
postgis functions
pointn(geometry, 0) used to return the first point of the geometry (a 
linestring, or
polygon, etc.),  this now returns NULL and needs to be replaced by 
pointn(geometry, 1).
Same applies for geometryn(geom, 0/1) for a MULTIgeometry.

I found some obscure reference to the intention to move to 1-based indexing
from 2003, but nothing in the release notes. The move is apparently 
conform some
(OpenGIS?) standard (probably defined by a geographer rather than a 
programmer).

I tried to find some clues to this in the this mail-list, but that's 
hard, because
I can't search it for keyword[s]. Maybe it's worth putting it somewhere 
in the
list of upgrades.

I have another, more annoying one, which I will detail in my next message,

Otherwise, keep up the good work,

Guido Lemoine




More information about the postgis-users mailing list