[postgis-devel] ST_AsText(geometry) 2.0

Paul Ramsey pramsey at opengeo.org
Mon Dec 6 14:31:26 PST 2010

No, the names collide, here's the ISO definition

"The null-call method ST_AsText() returns a CHARACTER LARGE OBJECT
value containing the well-known text representation of SELF. Values
shall be produced in the BNF for <well-known text representation>."

I don't think having "AsText" return OGC and "ST_AsText" return ISO is
a good fix, as ST_AsText and AsText have been synonyms since 1.2.


On Mon, Dec 6, 2010 at 2:27 PM, strk <strk at keybit.net> wrote:
> On Mon, Dec 06, 2010 at 09:49:20AM -0800, Paul Ramsey wrote:
>> 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.
> In an ideal world you would emit OGC using OGC functions,
> and emit ISO from ISO functions, then you'll emit postgis
> formats by default :)
> Does OGC specify existance of an 'ST_AsText' function ?
> Or was it just 'AsText' ?
> What about ISO ?
> Are we still in time to make them behave differently ?
> --strk;
>  ()   Free GIS & Flash consultant/developer
>  /\   http://strk.keybit.net/services.html
> _______________________________________________
> 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