laravel-eloquent-spatial
laravel-eloquent-spatial copied to clipboard
`withDistance` casting to geometry when underlying column is geography
I have a geography column (called location) and the built-in withDistance and whereDistance functions are casting the column to a geometry (via GeometryExpression:normalize()). Are geography columns not supported?
public function normalize(ConnectionInterface $connection): string
{
return $connection instanceof PostgresConnection
? $this->expression.'::geometry'
: $this->expression;
}
You are right. Currently we cast to geometry while running spatial functions. I would appreciate PRs that fix it.