From fa453b03a6a20cc7339c766f6258434d028ed28c Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Wed, 20 Jun 2018 16:48:57 +0500 Subject: [PATCH] Fixed #29507 -- Added Oracle support for Envelope GIS function. --- django/contrib/gis/db/backends/oracle/operations.py | 3 ++- docs/ref/contrib/gis/db-api.txt | 2 +- docs/ref/contrib/gis/functions.txt | 6 ++++++ docs/releases/2.2.txt | 3 ++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/django/contrib/gis/db/backends/oracle/operations.py b/django/contrib/gis/db/backends/oracle/operations.py index f6b05bdd74..d2db7f8498 100644 --- a/django/contrib/gis/db/backends/oracle/operations.py +++ b/django/contrib/gis/db/backends/oracle/operations.py @@ -68,6 +68,7 @@ class OracleOperations(BaseSpatialOperations, DatabaseOperations): 'Centroid': 'SDO_GEOM.SDO_CENTROID', 'Difference': 'SDO_GEOM.SDO_DIFFERENCE', 'Distance': 'SDO_GEOM.SDO_DISTANCE', + 'Envelope': 'SDO_GEOM_MBR', 'Intersection': 'SDO_GEOM.SDO_INTERSECTION', 'IsValid': 'SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT', 'Length': 'SDO_GEOM.SDO_LENGTH', @@ -105,7 +106,7 @@ class OracleOperations(BaseSpatialOperations, DatabaseOperations): } unsupported_functions = { - 'AsGeoJSON', 'AsKML', 'AsSVG', 'Azimuth', 'Envelope', + 'AsGeoJSON', 'AsKML', 'AsSVG', 'Azimuth', 'ForcePolygonCW', 'ForceRHR', 'GeoHash', 'LineLocatePoint', 'MakeValid', 'MemSize', 'Scale', 'SnapToGrid', 'Translate', } diff --git a/docs/ref/contrib/gis/db-api.txt b/docs/ref/contrib/gis/db-api.txt index 453eaef966..a59ecf4aa6 100644 --- a/docs/ref/contrib/gis/db-api.txt +++ b/docs/ref/contrib/gis/db-api.txt @@ -381,7 +381,7 @@ Function PostGIS Oracle MySQL Spat :class:`Centroid` X X X X :class:`Difference` X X X X :class:`Distance` X X X X -:class:`Envelope` X X X +:class:`Envelope` X X X X :class:`ForceRHR` X :class:`GeoHash` X X (≥ 5.7.5) X (LWGEOM) :class:`Intersection` X X X X diff --git a/docs/ref/contrib/gis/functions.txt b/docs/ref/contrib/gis/functions.txt index 3a6a75d4c4..60476902bb 100644 --- a/docs/ref/contrib/gis/functions.txt +++ b/docs/ref/contrib/gis/functions.txt @@ -267,11 +267,17 @@ queryset is calculated:: *Availability*: `MySQL `__, +`Oracle +`__, `PostGIS `__, SpatiaLite Accepts a single geographic field or expression and returns the geometry representing the bounding box of the geometry. +.. versionchanged:: 2.2 + + Oracle support was added. + ``ForcePolygonCW`` ================== diff --git a/docs/releases/2.2.txt b/docs/releases/2.2.txt index 3e51e3c536..5994a054a6 100644 --- a/docs/releases/2.2.txt +++ b/docs/releases/2.2.txt @@ -56,7 +56,8 @@ Minor features :mod:`django.contrib.gis` ~~~~~~~~~~~~~~~~~~~~~~~~~ -* ... +* Added Oracle support for the + :class:`~django.contrib.gis.db.models.functions.Envelope` function. :mod:`django.contrib.messages` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~