Re: MySQL Spatial Data types

From: Tore Halset (halse..vv.ntnu.no)
Date: Mon Aug 11 2008 - 01:02:57 EDT

  • Next message: Rick Blair: "Re: MySQL Spatial Data types"

    On 11. aug.. 2008, at 04.54, Aristedes Maniatis wrote:

    >
    > On 11/08/2008, at 12:23 PM, Rick Blair wrote:
    >
    >> I have an existing mysql (5.1) database that has a column named
    >> location
    >> that is a POINT datatype. I used the DataModeler and attached to my
    >> database. I was able to use my existing schema, however the data
    >> type in
    >> the Modeler for that column show as OTHER. The class that was
    >> generated was
    >> had the following methods:
    >
    > I haven't used them myself, but you may need to use something like
    > JTS (http://www.vividsolutions.com/JTS) to get these data types
    > across JDBC into Cayenne. And then some customisation of the mysql
    > database adapter [1] might be needed.

    Here is an example how to convert between WKT in a database and JTS
    geomertries on the java side. You may have to modify it to let MySQL
    convert the POINT datatype from/to WKT.

    http://cwiki.apache.org/CAY/mapping-jts-geometries.html

    I am using this in production, but not with MySQL.

    Regards,
      - Tore.



    This archive was generated by hypermail 2.0.0 : Mon Aug 11 2008 - 01:03:48 EDT