DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(mysql.info) functions-to-convert-geometries-between-formats

Info Catalog (mysql.info) analysing-spatial-information (mysql.info) analysing-spatial-information (mysql.info) geometry-property-functions
 
 16.5.1 Geometry Format Conversion Functions
 -------------------------------------------
 
 MySQL supports the following functions for converting geometry values
 between internal format and either WKT or WKB format:
 
    * `AsBinary(G)'
 
      Converts a value in internal geometry format to its WKB
      representation and returns the binary result.
 
           SELECT AsBinary(g) FROM geom;
 
    * `AsText(G)'
 
      Converts a value in internal geometry format to its WKT
      representation and returns the string result.
 
           mysql> SET @g = 'LineString(1 1,2 2,3 3)';
           mysql> SELECT AsText(GeomFromText(@g));
           +--------------------------+
           | AsText(GeomFromText(@g)) |
           +--------------------------+
           | LINESTRING(1 1,2 2,3 3)  |
           +--------------------------+
 
    * `GeomFromText(WKT[,SRID])'
 
      Converts a string value from its WKT representation into internal
      geometry format and returns the result. A number of type-specific
      functions are also supported, such as `PointFromText()' and
      `LineFromText()'. See  gis-wkt-functions.
 
    * `GeomFromWKB(WKB[,SRID])'
 
      Converts a binary value from its WKB representation into internal
      geometry format and returns the result. A number of type-specific
      functions are also supported, such as `PointFromWKB()' and
      `LineFromWKB()'. See  gis-wkb-functions.
 
Info Catalog (mysql.info) analysing-spatial-information (mysql.info) analysing-spatial-information (mysql.info) geometry-property-functions
automatically generated byinfo2html