Fixed #34629 -- Added filtering support to GIS aggregates.

This commit is contained in:
Olivier Le Thanh Duong 2023-06-03 15:54:22 +02:00 committed by Mariusz Felisiak
parent c1cff3c471
commit 1b754d638d
7 changed files with 206 additions and 11 deletions

View file

@ -839,6 +839,8 @@ Oracle ``SDO_WITHIN_DISTANCE(poly, geom, 5)``
SpatiaLite ``PtDistWithin(poly, geom, 5)``
========== ======================================
.. _gis-aggregation-functions:
Aggregate Functions
-------------------
@ -868,7 +870,7 @@ Example:
``Collect``
~~~~~~~~~~~
.. class:: Collect(geo_field)
.. class:: Collect(geo_field, filter=None)
*Availability*: `PostGIS <https://postgis.net/docs/ST_Collect.html>`__,
SpatiaLite
@ -879,10 +881,14 @@ aggregate, except it can be several orders of magnitude faster than performing
a union because it rolls up geometries into a collection or multi object, not
caring about dissolving boundaries.
.. versionchanged:: 5.0
Support for using the ``filter`` argument was added.
``Extent``
~~~~~~~~~~
.. class:: Extent(geo_field)
.. class:: Extent(geo_field, filter=None)
*Availability*: `PostGIS <https://postgis.net/docs/ST_Extent.html>`__,
Oracle, SpatiaLite
@ -898,10 +904,14 @@ Example:
>>> print(qs["poly__extent"])
(-96.8016128540039, 29.7633724212646, -95.3631439208984, 32.782058715820)
.. versionchanged:: 5.0
Support for using the ``filter`` argument was added.
``Extent3D``
~~~~~~~~~~~~
.. class:: Extent3D(geo_field)
.. class:: Extent3D(geo_field, filter=None)
*Availability*: `PostGIS <https://postgis.net/docs/ST_3DExtent.html>`__
@ -917,10 +927,14 @@ Example:
>>> print(qs["poly__extent3d"])
(-96.8016128540039, 29.7633724212646, 0, -95.3631439208984, 32.782058715820, 0)
.. versionchanged:: 5.0
Support for using the ``filter`` argument was added.
``MakeLine``
~~~~~~~~~~~~
.. class:: MakeLine(geo_field)
.. class:: MakeLine(geo_field, filter=None)
*Availability*: `PostGIS <https://postgis.net/docs/ST_MakeLine.html>`__,
SpatiaLite
@ -936,10 +950,14 @@ Example:
>>> print(qs["poly__makeline"])
LINESTRING (-95.3631510000000020 29.7633739999999989, -96.8016109999999941 32.7820570000000018)
.. versionchanged:: 5.0
Support for using the ``filter`` argument was added.
``Union``
~~~~~~~~~
.. class:: Union(geo_field)
.. class:: Union(geo_field, filter=None)
*Availability*: `PostGIS <https://postgis.net/docs/ST_Union.html>`__,
Oracle, SpatiaLite
@ -963,6 +981,10 @@ Example:
... Union(poly)
... ) # A more sensible approach.
.. versionchanged:: 5.0
Support for using the ``filter`` argument was added.
.. rubric:: Footnotes
.. [#fnde9im] *See* `OpenGIS Simple Feature Specification For SQL <https://portal.ogc.org/files/?artifact_id=829>`_, at Ch. 2.1.13.2, p. 2-13 (The Dimensionally Extended Nine-Intersection Model).
.. [#fnsdorelate] *See* `SDO_RELATE documentation <https://docs.oracle.com/en/