#10514 - FeatureEditor filter by geometric area#10515
#10514 - FeatureEditor filter by geometric area#10515Gaetanbrl wants to merge 15 commits intogeosolutions-it:masterfrom
Conversation
fdacd45 to
dbb2fd3
Compare
|
Hi @Gaetanbrl thank you for contributing. We will review asap. |
There was a problem hiding this comment.
Thank you for the PR. In this review I reported all the things that I found that may look unconsistent or problematic.
- see my comments inline
- The original proposal and issue was regarding to restrict editing, but in this implementation, also the view mode encounter this filter. Also this makes the things a little unclear. Maybe the filter should be applied only in edit mode?
- I found a bug that I didn't investigated, so I write about it here, instead of inline. With this tool active, I see an error of "max stack exceed" as well as I try to apply a quick filter.
https://github.com/user-attachments/assets/0193f17b-bfc2-41a2-a152-184e9482c445
I didn't debug so I don't know the exact reason. Anyway usingspatialFieldcan problematic, because too related to the advanced filter form . I'd suggest to use "filters" instead, as reported in another inline comment.
| * Create spatialField filters array. | ||
| * Contains filters from viewportFilter, restrictedArea, exsting WFS filter | ||
| */ | ||
| export const additionnalGridFilters = (state) => { |
There was a problem hiding this comment.
Using this approach makes the sync with map not working. While it still makes sense with viewport filter (because the map already shows the features in map), here this makes things a little unconsistent, and it could be practical for the user to see only the allowed rows on the map. What do you think?
A more functional approach is to add / remove the filter to the query object, as well as the other filters, like quick filter, do.

The filters section recently added to the filter may help you to manage it in a easier way.
Basically you can add to the filter a section filters: that can contain and use cql filter to apply some additional logic.
You can identify these filters by id, adding your own property, to manage them (e.g. adding/removing).
There was a problem hiding this comment.
it could be practical for the user to see only the allowed rows on the map. What do you think?
Exactly, this is the expected behavior
Using this approach makes the sync with map not working.
Not really sur to understand. additionnalGridFilters methods is not dependent on the screen filter but but also uses it if activate. Maybe my code is wrong with I wanted to do.
Basically you can add to the filter a section filters: that can contain and use cql filter to apply some additional logic.
I will change the code to use filters section as you expect.
Thanks for this proposals @offtherailz .
There was a problem hiding this comment.
I will use this filter instead of spatialFilter :
{
"format": "cql",
"version": "1.0.0",
"body": `${restrictedAreaOperatorSelector(state)}(${attribute}, ${asWKT})`,
"id": `[${uniqueId("cql_restricted_area_")}]`,
"restrictedArea": true
};
|
@offtherailz Thank you for this detailed review. |
dbb2fd3 to
3925cf0
Compare
|
The source branch is now rebase / align with master (8e2d443) |
After read the filters doc it's not easy to identify what filter I need to use and how to use it correctly. This doc say about spatialField (considered as problematic) :
I guess this is a state changes to apply with a specific filter object. But what should I replace the spatialFilter filter with ? logic or mapstore-query-panel or cql ? This doc is a good practice overview but a I can enhance this doc if i correctly understand how to use it with a use case. |
After some discussions, we will make the expected changes (see comments).
About this point, the natif request is to limit view by an area in edit mode and read mode. The natif use case is to limit view and edition according to geOrchestra restricted area (this area is applied to the user's organization via geOrchestra console app). So, we propose to add a configuration to manage 2 options :
Needs investigation. I've seen this error before with CQL filters and geoServer limits (cross layer filter limit ?). |
|
@offtherailz Thank you so much for previous feedback. But I need another one to continue. |
MV88
left a comment
There was a problem hiding this comment.
Hi @Gaetanbrl I resumed the review recently and i think you are still working on it right?
if so consider this as a partial review, since changes still have to be submitted yet
all of the following must have unit tests covering changes
- selectors
- reducers
- actions
- epics
please checkout also inline comments
also if you can go through the various conversation and add a comment to say which can be resolved or not.
Thanks
| * Create spatialField filters array. | ||
| * Contains filters from viewportFilter, restrictedArea, exsting WFS filter | ||
| */ | ||
| export const additionnalGridFilters = (state) => { |
|
@MV88 thank you for this review and your precious time (which we all miss).
Yes, but last comment (here) waiting for some feedback about this comment and this comment. So, I didn't move forward, having no additional interaction. I've been away since your last comment, I'll get back now to work on this contribution to change technicals points but I always need a feedback about functional elements. |
restricted area documentation Lint and clean
3925cf0 to
abeeffc
Compare
|
@MV88 you answer "Is this done ?" about some remaining returns : It would be really nice if you could give me some feedback on this
Thank you very much for these clarifications (@offtherailz). |
|
Here is a summary of the covered items. Changes Following Reviews
Outstanding Points
This last error seems related to |
|
@Gaetanbrl I'm sorry, thank you for this but this PR is quite old now. Do you have plans to re-handle this according to our review above and pending outstanding stuff? Otherwise, I would like to close the PR. |
|
Same as #10524. I can look into updating the PR, but I’m not certain it will still be sufficient... |
Description
This improvement will change the featureEditor plugin to allow to limit attributes table features loading by a geometric area (WKT or GeoJSON) for non ADMIN users.
This improvement don't use GeoFence and use a simple geometry.
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?
User can filter attribute table by custom filter or viewport.
#10514
What is the new behavior?
If configured, attribute table keep natives filters and use an additional geometric filter that can be create from URL (e.g geOrchestra restricted area) or from RAW (GEOJSON or WKT).
Breaking change
Does this PR introduce a breaking change? (check one with "x", remove the other)
Other useful information