nansencenter / django-geo-spaas

GeoDjango apps for satellite data management in Geo-Scientific Platform as a Service
GNU General Public License v3.0
20 stars 6 forks source link

"overlaps" filtering should be used instead of "intersects" filtering of spatial search #123

Closed opsdep closed 4 years ago

opsdep commented 4 years ago

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'])

opsdep commented 4 years ago

@akorosov @aperrin66 Please provide your feedback regarding this issue, individually.

@akorosov @aperrin66 This is a tiny issue but very important.

aperrin66 commented 4 years ago

Thanks for paying attention to this detail, but actually, it's the other way around:

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.

opsdep commented 4 years ago

@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: image

And then in a larger region(but at the same location), I search again with larger one:

image

And the result is something like this: image

It only shows the ones that are mainly in intersection of the border of the datasets

opsdep commented 4 years ago

Is there any inconsistency between the showing and filtering the datasets?

aperrin66 commented 4 years ago

This is because only the results in the current page are displayed.