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

Error when using ST::transform(): could not parse proj string '4326' #91

Open
saibotk opened this issue Jun 17, 2024 Discussed in #90 · 0 comments
Open

Error when using ST::transform(): could not parse proj string '4326' #91

saibotk opened this issue Jun 17, 2024 Discussed in #90 · 0 comments
Labels
bug Something isn't working

Comments

@saibotk
Copy link
Member

saibotk commented Jun 17, 2024

Discussed in #90

Originally posted by BezBIS June 17, 2024
I am getting an error when trying to pass a srid to ST::transform() as part of a select statement. A minimal example is:

$geom = Site::stSelect(ST::transform('geom', 4326))->first();

and the error is

SQLSTATE[XX000]: Internal error: 7 ERROR: could not parse proj string '4326' CONTEXT: SQL function "st_transform" statement 1

Running the generated query through pgAdmin works correctly, as does using selectRaw. I want to avoid selectRaw, however, as I want to get the extent of the transformed geometry as a Box2D:

$bounds = Site::stSelect(ST::extent(
    ST::transform('geom', 4326)
))
    ->where('id', '=', $search->params['site'])
    ->first();

As I'm fairly new to the library, it's entirely possible I'm missing something. That being the case, I thought I would ask fr help as a discussion before opening a bug report.

Raw SQL seems to be correct, we need to dive deeper to see what is actually send to the DB etc.

@saibotk saibotk added the bug Something isn't working label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant