diff --git a/lib/CrEOF/Spatial/PHP/Types/AbstractGeometry.php b/lib/CrEOF/Spatial/PHP/Types/AbstractGeometry.php index adc5a21e..9f75744d 100644 --- a/lib/CrEOF/Spatial/PHP/Types/AbstractGeometry.php +++ b/lib/CrEOF/Spatial/PHP/Types/AbstractGeometry.php @@ -32,7 +32,7 @@ * @author Derek J. Lambert * @license http://dlambert.mit-license.org MIT */ -abstract class AbstractGeometry implements GeometryInterface +abstract class AbstractGeometry implements GeometryInterface, \JsonSerializable { /** * @var int @@ -65,6 +65,14 @@ public function toJson() return json_encode($json); } + /** + * @return array + */ + public function jsonSerialize() + { + return $this->toArray(); + } + /** * @return null|int */