creof/doctrine2-spatial

Spatial indexes

n-sviridenko opened this issue · 4 comments

I need to have an ability to create spatial indexes:
http://dev.mysql.com/doc/refman/5.7/en/creating-spatial-indexes.html

@FredoVelcro @n-sviridenko interested in contributing a PR?

not sure what does not work I added index int oentity annotation and doctrine/migrations generated correct migrations

 * @ORM\Table(
 *     name="profiles",
 *     indexes={
 *          @ORM\Index(name="location_sp", columns={"location"}, flags={"spatial"})
 *     }
 * )

and generated this:

$this->addSql('ALTER TABLE profiles ADD location POINT NOT NULL COMMENT \'(DC2Type:point)\'');
$this->addSql('CREATE SPATIAL INDEX location_sp ON profiles (location)');

@svycka You must have jsor/doctrine-postgis event subscriber registered. It wont work otherwise with creof/doctrine2-spatial AFAIK.

That said, is there any work being done to get spatial index support ?