A Yii2 library to convert postgis coordinates to array and array to postgis text
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is even with perspectivain:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
LICENSE
README.md
composer.json

README.md

PHP Postgis

A PHP Trait to convert Postgis coordinates to array and a PHP array to Postgis text.

Currently supports Point and Polygon types.

Usage

Use it as PHP trait.

<?php
use perspectivain\postgis\PostgisTrait;

class Customer extends ActiveRecord
{
    use PostgisTrait;
    ...
}

...

$coordinates = $model->WktToArray('Polygon', 'city_coordinates');

$model->city_coordinates = $model->arrayToWkt('Polygon', $coordinates);

Installing

The preferred way to install this extension is through Composer.

{
  "require": {
    "perspectivain/php-postgis": "*"
  }
}