| 1 |
from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures |
| 2 |
from django.db.backends.sqlite3.features import ( |
| 3 |
DatabaseFeatures as SQLiteDatabaseFeatures, |
| 4 |
) |
| 5 |
from django.utils.functional import cached_property |
| 6 |
|
| 7 |
|
| 8 |
class DatabaseFeatures(BaseSpatialFeatures, SQLiteDatabaseFeatures): |
| 9 |
can_alter_geometry_field = False # Not implemented |
| 10 |
supports_3d_storage = True |
| 11 |
|
| 12 |
@cached_property |
| 13 |
def supports_area_geodetic(self): |
| 14 |
return bool(self.connection.ops.geom_lib_version()) |
| 15 |
|
| 16 |
@cached_property |
| 17 |
def django_test_skips(self): |
| 18 |
skips = super().django_test_skips |
| 19 |
skips.update( |
| 20 |
{ |
| 21 |
"SpatiaLite doesn't support distance lookups with Distance objects.": { |
| 22 |
"gis_tests.geogapp.tests.GeographyTest.test02_distance_lookup", |
| 23 |
}, |
| 24 |
} |
| 25 |
) |
| 26 |
return skips |