MySQL Forums
Forum List  »  GIS

Help - build table of POINT
Posted by: Tom Pouce
Date: October 19, 2008 07:16AM

Hi,

I'm new to mysql and opengis.

I have a table of cities with coordinates latitude and longitude and I'd like to create a row which would contain coordinate of type POINT.

mysql> describe cities;
+----------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(64) | NO | | | |
| lat | double | NO | | 0 | |
| lng | double | NO | | 0 | |
| coord | point | YES | | NULL | |
+----------+-------------+------+-----+---------+----------------+
5 rows in set (0.01 sec)

I tried something like that:
UPDATE cities SET coord=GeomFromText('POINT(lat lng)'));

But it didn't work. The syntax is incorrect.
How can I do that?

Thank you in advance for your help.

Options: ReplyQuote


Subject
Views
Written By
Posted
Help - build table of POINT
4667
October 19, 2008 07:16AM
3195
October 23, 2008 12:24AM
2912
October 25, 2008 12:22PM
3119
October 27, 2008 03:42AM


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.