Download the PHP package bakeoff/geospatial without Composer
On this page you can find all versions of the php package bakeoff/geospatial. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bakeoff/geospatial
More information about bakeoff/geospatial
Files in bakeoff/geospatial
Package geospatial
Short Description CakePHP Behavior to simplify working with geospatial database columns
License
Homepage https://github.com/mehov/cakephp-geospatial
Informations about the package geospatial
CakePHP 5: Geospatial Behavior for Tables
CakePHP 5.1.0 introduced limited support for geospatial types.
The
geometry,point,linestring, andpolygontypes are also known as the “geospatial types”. CakePHP offers limited support for geospatial columns. Currently they can be defined in migrations, read in schema reflection, and have values set as text.
Because internally all of the above are typemapped to \Cake\Database\Type\StringType, CakePHP:
- reads them as string, resulting in binary gibberish;
- writes them as literal string (
'POINT(0 0)'), resulting in database errors ("SQLSTATE[22003]: Numeric value out of range: 1416 Cannot get geometry object from data you send to the GEOMETRY field").
This plugin offers a quick Behavior you can attach to your tables having geospatial columns. In the spirit of convention over configuration, these geospatial columns will be detected automatically, so you don't have to explicitly configure anything. It will then become much simpler and faster to read from, and write to them.
Note: right now this plugin supports the POINT type only.
Setting up
Install:
In your Table classes:
Reading POINT
Get your entities as usual. The geospatial columns will be parsed.