Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to update geometry field with MultiPoint #183

Open
sookoll opened this issue Feb 1, 2022 · 1 comment
Open

Not able to update geometry field with MultiPoint #183

sookoll opened this issue Feb 1, 2022 · 1 comment

Comments

@sookoll
Copy link

sookoll commented Feb 1, 2022

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?

@sikhlana
Copy link
Contributor

Did you add location to the $spatialFields property?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants