Skip to content

A Yii2 library to convert postgis coordinates to array and array to postgis text

License

Notifications You must be signed in to change notification settings

fidelize/php-postgis

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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": "*"
  }
}

About

A Yii2 library to convert postgis coordinates to array and array to postgis text

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%