- Catégories :
ST_ASWKT , ST_ASTEXT¶
Étant donné une valeur de type GEOGRAPHY, renvoyez la représentation du texte (VARCHAR) de cette valeur au format WKT (texte bien connu).
- Voir aussi :
Syntaxe¶
Utilisez l’une des méthodes suivantes :
ST_ASWKT( <geography_expression> )
ST_ASTEXT( <geography_expression> )
Arguments¶
expression_géographie
L’argument doit être une expression de type GEOGRAPHY.
Renvoie¶
Un VARCHAR.
Notes sur l’utilisation¶
ST_ASTEXT est un alias pour ST_ASWKT.
Pour renvoyer la sortie au format EWKT, utilisez plutôt ST_ASEWKT.
Exemples¶
L’exemple suivant illustre la fonction ST_ASWKT :
create table geospatial_table (g GEOGRAPHY); insert into geospatial_table values ('POINT(-122.35 37.55)'), ('LINESTRING(-124.20 42.00, -120.01 41.99)');select st_astext(g) from geospatial_table; +-------------------------------------+ | ST_ASTEXT(G) | |-------------------------------------| | POINT(-122.35 37.55) | | LINESTRING(-124.2 42,-120.01 41.99) | +-------------------------------------+select st_aswkt(g) from geospatial_table; +-------------------------------------+ | ST_ASWKT(G) | |-------------------------------------| | POINT(-122.35 37.55) | | LINESTRING(-124.2 42,-120.01 41.99) | +-------------------------------------+