MySQL Forums
Forum List  »  GIS

Re: Storing Arc Type Coordinates in MySQL 5
Posted by: Alexander Barkov
Date: December 01, 2006 07:06AM

You can create geometry object using three ways:
- WKT Functions
- WKB Functions
- Using MySQL-Specific Functions


This example inserts a MultiLineString value using WKT:



mysql> CREATE TABLE t1 (g geometry);
Query OK, 0 rows affected (0.01 sec)

mysql> INSERT INTO t1 VALUES (GeomFromText('MULTILINESTRING(
'> (837673.49483448 897799.87646918, 0 0),
'> (838780.86205188 897369.23366241, 0 0),
'> (839170.49125801 897164.16565918, 0 0),
'> (839970.25647058 896651.49565112, 0 0),
'> (840542.51994158 895979.67802725, 0 0)
'> )'));
Query OK, 1 row affected (0.01 sec)

mysql> SELECT AsText(g) FROM t1;
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| AsText(g) |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| MULTILINESTRING((837673.49483448 897799.87646918,0 0),(838780.86205188 897369.23366241,0 0),(839170.49125801 897164.16565918,0 0),(839970.25647058 896651.49565112,0 0),(840542.51994158 895979.67802725,0 0)) |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql>



Please follow this manual section for further information:
http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html

Options: ReplyQuote


Subject
Views
Written By
Posted
6973
November 13, 2006 05:56AM
Re: Storing Arc Type Coordinates in MySQL 5
3944
December 01, 2006 07:06AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.