Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
d47498c5
Kaydet (Commit)
d47498c5
authored
Şub 04, 2019
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #30156 -- Dropped support for SpatiaLite 4.1 and 4.2.
üst
4763c971
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
31 deletions
+17
-31
operations.py
django/contrib/gis/db/backends/spatialite/operations.py
+8
-23
math.py
django/db/models/functions/math.py
+2
-4
geolibs.txt
docs/ref/contrib/gis/install/geolibs.txt
+1
-3
index.txt
docs/ref/contrib/gis/install/index.txt
+1
-1
3.0.txt
docs/releases/3.0.txt
+5
-0
No files found.
django/contrib/gis/db/backends/spatialite/operations.py
Dosyayı görüntüle @
d47498c5
"""
SQL functions reference lists:
https://www.gaia-gis.it/gaia-sins/spatialite-sql-4.
2.1
.html
https://www.gaia-gis.it/gaia-sins/spatialite-sql-4.
3.0
.html
"""
from
django.contrib.gis.db.backends.base.operations
import
(
BaseSpatialOperations
,
...
...
@@ -9,7 +9,7 @@ from django.contrib.gis.db.backends.spatialite.adapter import SpatiaLiteAdapter
from
django.contrib.gis.db.backends.utils
import
SpatialOperator
from
django.contrib.gis.db.models
import
aggregates
from
django.contrib.gis.geos.geometry
import
GEOSGeometry
,
GEOSGeometryBase
from
django.contrib.gis.geos.prototypes.io
import
wkb_r
,
wkt_r
from
django.contrib.gis.geos.prototypes.io
import
wkb_r
from
django.contrib.gis.measure
import
Distance
from
django.core.exceptions
import
ImproperlyConfigured
from
django.db.backends.sqlite3.operations
import
DatabaseOperations
...
...
@@ -64,9 +64,7 @@ class SpatiaLiteOperations(BaseSpatialOperations, DatabaseOperations):
disallowed_aggregates
=
(
aggregates
.
Extent3D
,)
@cached_property
def
select
(
self
):
return
'CAST (AsEWKB(
%
s) AS BLOB)'
if
self
.
spatial_version
>=
(
4
,
3
,
0
)
else
'AsText(
%
s)'
select
=
'CAST (AsEWKB(
%
s) AS BLOB)'
function_names
=
{
'ForcePolygonCW'
:
'ST_ForceLHR'
,
...
...
@@ -98,8 +96,8 @@ class SpatiaLiteOperations(BaseSpatialOperations, DatabaseOperations):
self
.
connection
.
settings_dict
[
'NAME'
],
)
)
from
exc
if
version
<
(
4
,
1
,
0
):
raise
ImproperlyConfigured
(
'GeoDjango
only supports SpatiaLite versions 4.1
.0 and above.'
)
if
version
<
(
4
,
3
,
0
):
raise
ImproperlyConfigured
(
'GeoDjango
supports SpatiaLite 4.3
.0 and above.'
)
return
version
def
convert_extent
(
self
,
box
):
...
...
@@ -199,21 +197,8 @@ class SpatiaLiteOperations(BaseSpatialOperations, DatabaseOperations):
def
get_geometry_converter
(
self
,
expression
):
geom_class
=
expression
.
output_field
.
geom_class
if
self
.
spatial_version
>=
(
4
,
3
,
0
):
read
=
wkb_r
()
.
read
read
=
wkb_r
()
.
read
def
converter
(
value
,
expression
,
connection
):
return
None
if
value
is
None
else
GEOSGeometryBase
(
read
(
value
),
geom_class
)
else
:
read
=
wkt_r
()
.
read
srid
=
expression
.
output_field
.
srid
if
srid
==
-
1
:
srid
=
None
def
converter
(
value
,
expression
,
connection
):
if
value
is
not
None
:
geom
=
GEOSGeometryBase
(
read
(
value
),
geom_class
)
if
srid
:
geom
.
srid
=
srid
return
geom
def
converter
(
value
,
expression
,
connection
):
return
None
if
value
is
None
else
GEOSGeometryBase
(
read
(
value
),
geom_class
)
return
converter
django/db/models/functions/math.py
Dosyayı görüntüle @
d47498c5
...
...
@@ -34,12 +34,10 @@ class ATan2(NumericOutputFieldMixin, Func):
arity
=
2
def
as_sqlite
(
self
,
compiler
,
connection
,
**
extra_context
):
if
not
getattr
(
connection
.
ops
,
'spatialite'
,
False
)
or
not
(
(
4
,
3
,
0
)
<=
connection
.
ops
.
spatial_version
<
(
5
,
0
,
0
)
):
if
not
getattr
(
connection
.
ops
,
'spatialite'
,
False
)
or
connection
.
ops
.
spatial_version
>=
(
5
,
0
,
0
):
return
self
.
as_sql
(
compiler
,
connection
)
# This function is usually ATan2(y, x), returning the inverse tangent
# of y / x, but it's ATan2(x, y) on SpatiaLite
>= 4.3.0,
< 5.0.0.
# of y / x, but it's ATan2(x, y) on SpatiaLite < 5.0.0.
# Cast integers to float to avoid inconsistent/buggy behavior if the
# arguments are mixed between integer and float or decimal.
# https://www.gaia-gis.it/fossil/libspatialite/tktview?name=0f72cca3a2
...
...
docs/ref/contrib/gis/install/geolibs.txt
Dosyayı görüntüle @
d47498c5
...
...
@@ -13,7 +13,7 @@ Program Description Required
:doc:`GDAL <../gdal>` Geospatial Data Abstraction Library Yes 2.3, 2.2, 2.1, 2.0, 1.11
:doc:`GeoIP <../geoip2>` IP-based geolocation library No 2
`PostGIS`__ Spatial extensions for PostgreSQL Yes (PostgreSQL only) 2.5, 2.4, 2.3, 2.2, 2.1
`SpatiaLite`__ Spatial extensions for SQLite Yes (SQLite only) 4.3
, 4.2, 4.1
`SpatiaLite`__ Spatial extensions for SQLite Yes (SQLite only) 4.3
======================== ==================================== ================================ ===================================
Note that older or more recent versions of these libraries *may* also work
...
...
@@ -35,8 +35,6 @@ totally fine with GeoDjango. Your mileage may vary.
PostGIS 2.3.0 2016-09-26
PostGIS 2.4.0 2017-09-30
PostGIS 2.5.0 2018-09-23
SpatiaLite 4.1.0 2013-06-04
SpatiaLite 4.2.0 2014-07-25
SpatiaLite 4.3.0 2015-09-07
.. note::
...
...
docs/ref/contrib/gis/install/index.txt
Dosyayı görüntüle @
d47498c5
...
...
@@ -61,7 +61,7 @@ Database Library Requirements Supported Versions Notes
PostgreSQL GEOS, GDAL, PROJ.4, PostGIS 9.4+ Requires PostGIS.
MySQL GEOS, GDAL 5.6+ Not OGC-compliant; :ref:`limited functionality <mysql-spatial-limitations>`.
Oracle GEOS, GDAL 12.1+ XE not supported.
SQLite GEOS, GDAL, PROJ.4, SpatiaLite 3.8.3+ Requires SpatiaLite 4.
1
+
SQLite GEOS, GDAL, PROJ.4, SpatiaLite 3.8.3+ Requires SpatiaLite 4.
3
+
================== ============================== ================== =========================================
See also `this comparison matrix`__ on the OSGeo Wiki for
...
...
docs/releases/3.0.txt
Dosyayı görüntüle @
d47498c5
...
...
@@ -222,6 +222,11 @@ backends.
``can_return_ids_from_bulk_insert`` are renamed to
``can_return_columns_from_insert`` and ``can_return_rows_from_bulk_insert``.
:mod:`django.contrib.gis`
-------------------------
* Support for SpatiaLite 4.1 and 4.2 is removed.
Miscellaneous
-------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment