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

withDistance casting to geometry when underlying column is geography #123

Open
AlexGodbehere opened this issue May 26, 2024 · 1 comment

Comments

@AlexGodbehere
Copy link

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 AlexGodbehere changed the title withDistance casting to geometry withDistance casting to geometry when underlying column is geography May 26, 2024
@MatanYadaev
Copy link
Owner

You are right. Currently we cast to geometry while running spatial functions.
I would appreciate PRs that fix it.

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