-
Notifications
You must be signed in to change notification settings - Fork 409
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
#9285 support for CQL function parsing and XML conversion #9300
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
just a few things
throw new Error("WKT parsing for CQL filter not supported yet"); | ||
}; // TODO: use wkt-parser | ||
const spatialOperators = { | ||
import {toGeoJSON} from '../../WKT'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be changed to toGeoJSONGeometry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is a correct name. WKT provides only syntax for geometries, so it is implicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I strongly disagree and at this point is pointless discuss further so I'm going to approve it as you did.
|
||
/** | ||
* Parse a CQL filter. returns an AST object representation of the filter. | ||
* For the moment this parser doesn't support WKT parsing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be removed or edited?
* For the moment this parser doesn't support WKT parsing. | |
* For the moment this parser doesn't support WKT parsing. |
if (includes(logical, type)) { | ||
return filterBuilder[type]( | ||
...filters.map(fromObject(filterBuilder)) | ||
); | ||
} | ||
if (includes(cql, type)) { | ||
return ""; | ||
return ""; // TODO: implement in filterBuilder as empty filter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include and Exclude are only part of CQL/ECQL of geoserver. They do not have a proper equivalent in OGC filters.
This is a suggestion for a future implementation of emptyFilter in filterBuilder, equivalent to the "include" cql filter
@@ -0,0 +1,144 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copyrights
@@ -0,0 +1,74 @@ | |||
import expect from 'expect'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copyrights
@@ -0,0 +1,144 @@ | |||
|
|||
const parsePoint = (coordinates) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add jsdoc for these functions
@@ -81,6 +125,13 @@ const parseMultiPolygon = (coordinates) => { | |||
}; | |||
}; | |||
let toGeoJSON; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this is a let and not exported as const ?
throw new Error("WKT parsing for CQL filter not supported yet"); | ||
}; // TODO: use wkt-parser | ||
const spatialOperators = { | ||
import {toGeoJSON} from '../../WKT'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I strongly disagree and at this point is pointless discuss further so I'm going to approve it as you did.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why toGeoJSON is a let and not exported as const?
can this be changed?
@MV88 https://stackoverflow.com/questions/32558514/javascript-es6-export-const-vs-export-let |
@ElenaGallo please test in DEV |
No additional UI test needed for this PR. Only existing test for the next release. |
Description
This PR introduce the capabilities to parse:
This PR allows additional tools like panels injected in the filter panel, to support advanced filtering functionalities. In particular it has been developed to support jsonArrayContains and jsonPointer.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
Issue
What is the current behavior?
Actually parsing CQL do not support WKT and functions.
What is the new behavior?
Fix #9285, introducing the support for parsing CQL functions, WKT and to convert these into XML OGC filters.
Breaking change
Does this PR introduce a breaking change? (check one with "x", remove the other)
Other useful information
This is an code only change. No new UI test needs to be added.