Ticket #1291 (closed defect: fixed)

Opened 11 months ago

Last modified 10 months ago

SPATIAL support for MySQL

Reported by: nalbion Owned by: romanb
Priority: minor Milestone:
Component: Native SQL Version: 1.0.0
Severity: Keywords: spatial mysql
Cc: Has Test: no
Status: Pending Core Response Has Patch: yes

Description

I've noticed that Doctrine_DataDict_Mysql->keywords includes 'SPATIAL', but not the specific spatial types: GEOMETRY, LINESTRING, POINT, POLYGON etc.  http://trac.phpdoctrine.org/browser/branches/0.11/lib/Doctrine/DataDict/Mysql.php

 http://dev.mysql.com/doc/refman/5.0/en/mysql-spatial-datatypes.html

There exists SPATIAL support for Oracle within PHP:  http://blogs.oracle.com/opal/2008/03/location_awareness_with_oracle.html

Attachments

spatial_fields.patch (1.5 KB) - added by killroyboy 11 months ago.
spatial fields handling in DataDict?_Mysql -- built against 1.0.0-BETA1 tag
doctrine_spatial_fields.patch (1.0 KB) - added by killroyboy 10 months ago.
updated spatial fields patch for RC1

Change History

Changed 11 months ago by romanb

  • milestone changed from 1.0.0-RC1 to 2.0.0

Changed 11 months ago by killroyboy

spatial fields handling in DataDict?_Mysql -- built against 1.0.0-BETA1 tag

Changed 11 months ago by killroyboy

Is there any way to get this patch applied for 1.0?

Changed 11 months ago by killroyboy

  • has_patch set

Changed 11 months ago by lsmith

This should be separated as much as possible from the core. Since there is no standard on this stuff it would suck to have an RDBMS specific solution inside Doctrine core. I am not sure if its possible to really fold other RDBMS spatial API's (PostGis? etc.) into a single API, but that is of course something that takes a fair amount of effort.

IIRC the last time I looked at the datatypes in Doctrine they were fairly "hardcoded" aka non extensible (a problem also seen in other areas of Doctrine like the supported drivers). In MDB2 I put in a fair amount of work to make it possible to create custom data types. This might also be something to look into ..

Changed 11 months ago by romanb

I think the part of the patch that addresses getPortableDeclaration() is ok. Having this in there means an existing schema with these column types can be properly imported. The other way around does not make sense because of what lsmith said.

Changed 11 months ago by killroyboy

As I indicated on the mailing list [1], I'm totally fine with just the getPortableDeclaration part. Would you like me to update the patch or is it easier to just hack it in?

Thanks!

[1]  http://groups.google.com/group/doctrine-user/browse_thread/thread/b1008f62d6d0b2b7

Changed 11 months ago by nalbion

Thanks for your work on this!

Changed 10 months ago by killroyboy

updated spatial fields patch for RC1

Changed 10 months ago by killroyboy

I could really use this in 1.0 so I don't have to keep patching each release. Could someone apply this latest patch?

Changed 10 months ago by romanb

  • status changed from new to closed
  • resolution set to fixed

(In [4815]) Fixed #1291. Patch applied.

Changed 10 months ago by jwage

  • version changed from Trunk to 1.0
  • milestone changed from 2.0.0 to 1.0.0-RC2

Changed 10 months ago by anonymous

  • milestone New deleted

Milestone New deleted

Note: See TracTickets for help on using tickets.