[SOLVED] ST_AsText options?

Issue

This Content is from Stack Overflow. Question asked by neubert

https://dev.mysql.com/doc/refman/8.0/en/gis-format-conversion-functions.html#function_st-astext gives the following function definition for ST_AsText:

ST_AsText(g [, options])

It also states the following:

An optional options argument may be given to override the default axis order.

It, however, gives no examples of what to set options to.

I tried ST_AsText(g, 1) and I got this error:

Error Code: 3560. The string ‘1’ is not a valid key = value pair in function st_astext.

Any ideas?



Solution

On this mysql doc page the introduction section says:

An optional options argument may be given to override the default axis order. options consists of a list of comma-separated key=value. The only permitted key value is axis-order, with permitted values of lat-long, long-lat and srid-defined (the default).

So I would try passing "axis-order=long-lat".


This Question was asked in StackOverflow by neubert and Answered by Michael Entin It is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?