Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Cared for PostGIS 2 renamed operations

  • Loading branch information...
commit 864a0514b85637ee92d6f1ba596997195dfc7107 1 parent 92b5341
Claude Paroz authored September 23, 2012
12  django/contrib/gis/db/backends/postgis/operations.py
@@ -231,7 +231,6 @@ def get_dist_ops(operator):
231 231
         self.distance_spheroid = prefix + 'distance_spheroid'
232 232
         self.envelope = prefix + 'Envelope'
233 233
         self.extent = prefix + 'Extent'
234  
-        self.extent3d = prefix + 'Extent3D'
235 234
         self.force_rhr = prefix + 'ForceRHR'
236 235
         self.geohash = GEOHASH
237 236
         self.geojson = GEOJSON
@@ -239,14 +238,12 @@ def get_dist_ops(operator):
239 238
         self.intersection = prefix + 'Intersection'
240 239
         self.kml = prefix + 'AsKML'
241 240
         self.length = prefix + 'Length'
242  
-        self.length3d = prefix + 'Length3D'
243 241
         self.length_spheroid = prefix + 'length_spheroid'
244 242
         self.makeline = prefix + 'MakeLine'
245 243
         self.mem_size = prefix + 'mem_size'
246 244
         self.num_geom = prefix + 'NumGeometries'
247 245
         self.num_points =prefix + 'npoints'
248 246
         self.perimeter = prefix + 'Perimeter'
249  
-        self.perimeter3d = prefix + 'Perimeter3D'
250 247
         self.point_on_surface = prefix + 'PointOnSurface'
251 248
         self.polygonize = prefix + 'Polygonize'
252 249
         self.reverse = prefix + 'Reverse'
@@ -259,6 +256,15 @@ def get_dist_ops(operator):
259 256
         self.union = prefix + 'Union'
260 257
         self.unionagg = prefix + 'Union'
261 258
 
  259
+        if version >= (2, 0, 0):
  260
+            self.extent3d = prefix + '3DExtent'
  261
+            self.length3d = prefix + '3DLength'
  262
+            self.perimeter3d = prefix + '3DPerimeter'
  263
+        else:
  264
+            self.extent3d = prefix + 'Extent3D'
  265
+            self.length3d = prefix + 'Length3D'
  266
+            self.perimeter3d = prefix + 'Perimeter3D'
  267
+
262 268
     def check_aggregate_support(self, aggregate):
263 269
         """
264 270
         Checks if the given aggregate name is supported (that is, if it's

0 notes on commit 864a051

Please sign in to comment.
Something went wrong with that request. Please try again.