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

exponential numbers in cql filter are not parsed #141

Closed
simonseyock opened this issue Oct 6, 2023 · 2 comments
Closed

exponential numbers in cql filter are not parsed #141

simonseyock opened this issue Oct 6, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@simonseyock
Copy link

I don't know exactly if this is malformed WKT, but as it was produced by OpenLayers and is accepted by PostGIS directly, I assume this is an error in the CQL parser.

The problem occurs with exponential numbers like 1.3969838619232178e-9.

The CQL is:

INTERSECTS(geom, POLYGON((-2504688.542848654 2504688.542848654,-2504688.542848654 5009377.08569731,1.3969838619232178e-9 5009377.08569731,1.3969838619232178e-9 2504688.542848654,-2504688.542848654 2504688.542848654)))

The error is:

CQL syntax error: "...1,1.3969838619232178 !!>> e-9 5009377.08569731..."

The same WKT is parsed in PostGIS correctly:

select st_geomfromtext('POLYGON((-2504688.542848654 2504688.542848654, -2504688.542848654 5009377.08569731, 1.3969838619232178e-9 5009377.08569731, 1.3969838619232178e-9 2504688.542848654, -2504688.542848654 2504688.542848654))', 3857)
@simonseyock simonseyock changed the title exponential numbers in cql filter exponential numbers in cql filter are not parsed Oct 6, 2023
@dr-jts dr-jts added the bug Something isn't working label Oct 10, 2023
@dr-jts
Copy link
Collaborator

dr-jts commented Oct 10, 2023

It looks like the CQL parser only accepts exponential notation using upper-case E (code).

This should be an easy fix.

@dr-jts
Copy link
Collaborator

dr-jts commented Oct 10, 2023

Fixed in 82fab99

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

2 participants