You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but gives no results, though there are records with 0, 0 location.
I tried as well:
->where('location', newPoint(0, 0))
which gives an error Object of class TarfinLabs\LaravelSpatial\Types\Point could not be converted to string.
I even tried:
->withinDistanceTo('location', newPoint(0, 0), 0)
which produces:
where ST_AsText(location) !=POINT(00) and ST_Distance(ST_SRID(location, 4326), ST_SRID(Point(0, 0), 4326)) <=0
but unfortunately it gives us SQLSTATE[42000]: Syntax error or access violation: 1582 Incorrect parameter count in the call to native function 'ST_SRID' error. I bet it's the MariaDB specific problem. But after removing second parameter from ST_SRID(), and having
where ST_AsText(location) !=POINT(00) and ST_Distance(ST_SRID(location), ST_SRID(Point(0, 0))) <=0
there is still another error: SQLSTATE[HY000]: General error: 4079 Illegal parameter data type int for operation 'st_distance'.
The only form which works is:
->where('location', DB::raw('POINT(0, 0)'))
The text was updated successfully, but these errors were encountered:
Hi!
Unfortunately I'm still a little bit confused on how we should query model records for the specific location?
I tried these:
which produces this query:
but gives no results, though there are records with
0, 0
location.I tried as well:
which gives an error
Object of class TarfinLabs\LaravelSpatial\Types\Point could not be converted to string
.I even tried:
which produces:
but unfortunately it gives us
SQLSTATE[42000]: Syntax error or access violation: 1582 Incorrect parameter count in the call to native function 'ST_SRID'
error. I bet it's the MariaDB specific problem. But after removing second parameter fromST_SRID()
, and havingthere is still another error:
SQLSTATE[HY000]: General error: 4079 Illegal parameter data type int for operation 'st_distance'
.The only form which works is:
The text was updated successfully, but these errors were encountered: