Browse Source

Fixed #29507 -- Added Oracle support for Envelope GIS function.

Sergey Fedoseev 6 years ago
parent
commit
fa453b03a6

+ 2 - 1
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',
     }

+ 1 - 1
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

+ 6 - 0
docs/ref/contrib/gis/functions.txt

@@ -267,11 +267,17 @@ queryset is calculated::
 
 *Availability*: `MySQL
 <https://dev.mysql.com/doc/refman/en/gis-general-property-functions.html#function_st-envelope>`__,
+`Oracle
+<https://docs.oracle.com/database/121/SPATL/sdo_geom-sdo_mbr.htm#GUID-646638D0-2C5F-490A-AF63-DE9B7A4C97C1__CHDJCEIH>`__,
 `PostGIS <https://postgis.net/docs/ST_Envelope.html>`__, 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``
 ==================
 

+ 2 - 1
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`
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~