Page 1 of 1

About storing spatial data in embedded server

Posted: Fri 25 Feb 2005 13:26
by Guest
I just tested the embedded server. Who can tell me how to store spatial data in embedded server?

Posted: Mon 28 Feb 2005 11:16
by Serious
There are two standard spatial data formats that are used to represent geometry objects in queries. They are:
1. Well-Known Text (WKT) format
2. Well-Known Binary (WKB) format
Internally, MySQL stores geometry values in a format that is not identical to either WKT or WKB format.

MySqlDirect does not support internal spatial data format. In order to use spatial data tou can use following functions:

Code: Select all

GeomFromText
GeomFromWKB
AsText
AsBinary
...
Example:

Code: Select all

create table geom(pt point);
insert into geom values(GeomFromText('point(1 1)'));
select astext(pt) from geom;
select asbinary(pt) from geom;
For more information refer to MySQL manual.