laravel-mysql-spatial
laravel-mysql-spatial copied to clipboard
Not able to update geometry field with MultiPoint
private array $locations = [];
...
$this->locations[] = new Point($y, $x);
...
DB::table('table')->whereId($id)->update(['location' => new MultiPoint($this->locations)]);
Error: SQLSTATE[22003]: Numeric value out of range: 1416 Cannot get geometry object from data you send to the GEOMETRY field (SQL: update table
set location
= (647298.25 6461126.89),(647550.63 6460742.56) where id
= 1)
In what world this SQL is valid SQL? Did I missed something and it should work some other way that documentation do not mention?
Did you add location
to the $spatialFields
property?