mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #26775 -- Supported dim=3 geography fields
Thanks François-Xavier Thomas for the report.
This commit is contained in:
@@ -268,18 +268,19 @@ class PostGISOperations(BaseSpatialOperations, DatabaseOperations):
|
||||
"""
|
||||
if f.geom_type == 'RASTER':
|
||||
return 'raster'
|
||||
elif f.geography:
|
||||
|
||||
# Type-based geometries.
|
||||
# TODO: Support 'M' extension.
|
||||
if f.dim == 3:
|
||||
geom_type = f.geom_type + 'Z'
|
||||
else:
|
||||
geom_type = f.geom_type
|
||||
if f.geography:
|
||||
if f.srid != 4326:
|
||||
raise NotImplementedError('PostGIS only supports geography columns with an SRID of 4326.')
|
||||
|
||||
return 'geography(%s,%d)' % (f.geom_type, f.srid)
|
||||
return 'geography(%s,%d)' % (geom_type, f.srid)
|
||||
else:
|
||||
# Type-based geometries.
|
||||
# TODO: Support 'M' extension.
|
||||
if f.dim == 3:
|
||||
geom_type = f.geom_type + 'Z'
|
||||
else:
|
||||
geom_type = f.geom_type
|
||||
return 'geometry(%s,%d)' % (geom_type, f.srid)
|
||||
|
||||
def get_distance(self, f, dist_val, lookup_type, handle_spheroid=True):
|
||||
|
||||
Reference in New Issue
Block a user