Closed opsdep closed 4 years ago
@akorosov @aperrin66 Please provide your feedback regarding this issue, individually.
@akorosov @aperrin66 This is a tiny issue but very important.
Thanks for paying attention to this detail, but actually, it's the other way around:
intersects
is true if the intersection of two geometries is not empty. This includes the case where one geometry contains the otheroverlaps
is true if the geometries intersect and one does not contain the other.This is confirmed by the documentation from PostGIS: http://postgis.net/docs/ST_Intersects.html and http://postgis.net/docs/ST_Overlaps.html, and by the documentation of Spatialite: https://www.gaia-gis.it/spatialite-2.0/spatialite2_sql.html.
@aperrin66 I have the docs. Yes, intersect is more comprehesive than the ovrelap. But why the user do not see the datasets that are completely inside the desired location? Let me show you an example: Here I have selected a small region for showing the datasets, it will show me some of the datasets:
And then in a larger region(but at the same location), I search again with larger one:
And the result is something like this:
It only shows the ones that are mainly in intersection of the border of the datasets
Is there any inconsistency between the showing and filtering the datasets?
This is because only the results in the current page are displayed.
Here in this line of filtering which is used for spatial filtering by user, the user wants to see all the datasets that are inside or have some overlap with the border of his/her desired region. When we use intersects, it only shows the datasets that have intersect with desired region, not the ones that are completely inside the desired region of the user. The user want the ones that are completely inside the desired region as well.
It means we have change the filtering verb from "intersects" to "overlaps" for this line: https://github.com/nansencenter/django-geo-spaas/blob/f88cec284af814dcca12ba73f67a328296936615/geospaas/base_viewer/forms.py#L46
Which means this line should be something like this:
python geographic_location__geometry__overlaps=self.cleaned_data['polygon'])