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

ST_* function arguments not recognized #185

Open
yurtesen opened this issue Nov 24, 2017 · 0 comments
Open

ST_* function arguments not recognized #185

yurtesen opened this issue Nov 24, 2017 · 0 comments

Comments

@yurtesen
Copy link

yurtesen commented Nov 24, 2017

I am not sure what I am doing wrong.

I have only 2 functions defined in the config.yml

                 ST_Intersects:       CrEOF\Spatial\ORM\Query\AST\Functions\PostgreSql\STIntersects
                 ST_MakeEnvelope:     CrEOF\Spatial\ORM\Query\AST\Functions\PostgreSql\STMakeEnvelope

I am trying to execute a simple query

->where('ST_Intersects(st.coords,ST_MakeEnvelope(-1,-1,1,1,4326))=true')

I get an error (I believe the dash is the minus dash of first element):

Error: Expected Literal, got '-'

I had no problems with the entity and doctrine generating database tables, fiends and indices.

Update: I have managed to get things working by wrapping then negative arguments in quotes. So the code below works:

->where("ST_Intersects(st.coords,ST_MakeEnvelope('-1','-1',1,1,4326))=true")

I think the problem is in AbstractSpatialDQLFunction.php in lines 77 and 82

    `$this->geomExpr[] = $parser->ArithmeticPrimary();`

Should perhaps be ?

    `$this->geomExpr[] = $parser->ArithmeticFactor();`
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

1 participant