Is MySQL geospatial extension supported in Google Cloud SQL?

405 views
Skip to first unread message

Sumit Arora

unread,
Mar 15, 2013, 8:34:59 PM3/15/13
to google-cloud...@googlegroups.com
Currently I'm using MySql 5.5 and I use to save GEOMETRY objects in database.

This is how my sql column look like:
<property name="regionMapGeometry" type="org.hibernatespatial.GeometryUserType">
            <column name="regionMapGeometry" 
                        sql-type="GEOMETRY"/> 
        </property>
Is sql-type="GEOMETRY" supported in Google Cloud SQL?

Razvan Musaloiu-E.

unread,
Mar 16, 2013, 1:38:54 AM3/16/13
to google-cloud...@googlegroups.com
Does that work with a local MySQL 5.5? Then it should also work with Google Cloud SQL. Note that the SPATIAL INDEX is only available for MyISAM tables which are not transactional and not recommended for Google Cloud SQL.

Example:

mysql> create table Points (  name VARCHAR(20) PRIMARY KEY,  location Point NOT NULL,  description VARCHAR(200),  SPATIAL INDEX(location)  ) engine=myisam;
Query OK, 0 rows affected (0.32 sec)

mysql> INSERT INTO Points (name, location) VALUES ( 'point1' , GeomFromText( ' POINT(31.5 42.2) ' ) );
Query OK, 1 row affected (0.14 sec)

mysql> SELECT name, AsText(location) FROM Points WHERE X(location) > 10\G
*************************** 1. row ***************************
            name: point1
AsText(location): POINT(31.5 42.2)
1 row in set (0.08 sec)

mysql>


-- Razvan ME


--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages