Skip to content

Doctrine2 multi-platform support for spatial types and functions.

Notifications You must be signed in to change notification settings

alisarac/doctrine2-spatial

 
 

Repository files navigation

doctrine2-spatial

This is a fork of doctrine2-spatial

Changes

  • MultiPolygon type is added

Symfony2 Install

The original package lacks install instructions. Here's how to add it to Symfony2:

composer.json

"repositories": [
    { "type": "vcs", "url": "https://github.com/alisarac/doctrine2-spatial" }
],
"require": {
	...
    "creof/doctrine2-spatial": "dev-master"

You will also have to change the version requirement of doctrine:

    "doctrine/orm": "dev-master",

These two changes have been made in various forks and versions, so check first.

config.yml

You need to manually add the types and functions you use:

doctrine:
    dbal:
        types:
            geometry:   CrEOF\Spatial\DBAL\Types\GeometryType
            point:      CrEOF\Spatial\DBAL\Types\Geometry\PointType
            polygon:    CrEOF\Spatial\DBAL\Types\Geometry\PolygonType
            linestring: CrEOF\Spatial\DBAL\Types\Geometry\LineStringType
    orm:
        dql:
            numeric_functions:
                st_contains:        CrEOF\Spatial\ORM\Query\AST\Functions\PostgreSql\STContains
                st_distance:        CrEOF\Spatial\ORM\Query\AST\Functions\PostgreSql\STDistance
                st_area:            CrEOF\Spatial\ORM\Query\AST\Functions\PostgreSql\STArea
                st_length:          CrEOF\Spatial\ORM\Query\AST\Functions\PostgreSql\STLength
                st_geomfromtext:    CrEOF\Spatial\ORM\Query\AST\Functions\PostgreSql\STGeomFromText

About

Doctrine2 multi-platform support for spatial types and functions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%