[postgis-devel] ST_AsText(geometry) 2.0

Paul Ramsey pramsey at opengeo.org
Mon Dec 6 09:49:20 PST 2010


I have in the past talked about changing the output of ST_AsText() to
emit the ISO SQL/MM well-known-text instead of the OGC.

For 2d features, there is no difference.

For higher dimensional features, the current behavior is to strip them
off and return 2d WKT. The ISO behavior is to return them, with
dimensional information. So an XYZ point would come out as 'POINT Z (0
0 0)' in ISO and as 'POINT(0 0)' in the current behavior. An XYM point
would be 'POINT M (0 0 0)'.

The ISO variants are certainly preferable in not dropping information
on the floor and in accurately conveying the dimensionality of the
features. The downside is the backwards breaking nature of the change.
Any applications that expect 2d WKT from AsText in all cases will be
surprised to occasionally receive 3d and 4d WKT.

Discussion?

Paul



More information about the postgis-devel mailing list