laravel-eloquent-spatial icon indicating copy to clipboard operation
laravel-eloquent-spatial copied to clipboard

`withDistance` casting to geometry when underlying column is geography

Open AlexGodbehere opened this issue 8 months ago • 1 comments

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;
    }

AlexGodbehere avatar May 26 '24 09:05 AlexGodbehere