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
08972528
Kaydet (Commit)
08972528
authored
Mar 21, 2017
tarafından
Sergey Fedoseev
Kaydeden (comit)
Tim Graham
Mar 21, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed more GeoQuerySet leftovers.
Follow up to
a0d16630
.
üst
816c5753
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
39 deletions
+11
-39
operations.py
django/contrib/gis/db/backends/oracle/operations.py
+2
-11
operations.py
django/contrib/gis/db/backends/postgis/operations.py
+2
-2
operations.py
django/contrib/gis/db/backends/spatialite/operations.py
+2
-15
aggregates.py
django/contrib/gis/db/models/aggregates.py
+2
-2
fields.py
django/contrib/gis/db/models/fields.py
+3
-9
No files found.
django/contrib/gis/db/backends/oracle/operations.py
Dosyayı görüntüle @
08972528
...
...
@@ -134,23 +134,14 @@ class OracleOperations(BaseSpatialOperations, DatabaseOperations):
)
if
internal_type
in
geometry_fields
:
converters
.
append
(
self
.
convert_textfield_value
)
if
hasattr
(
expression
.
output_field
,
'geom_type'
):
converters
.
append
(
self
.
convert_geometry
)
return
converters
def
convert_geometry
(
self
,
value
,
expression
,
connection
,
context
):
if
value
:
value
=
Geometry
(
value
)
if
'transformed_srid'
in
context
:
value
.
srid
=
context
[
'transformed_srid'
]
return
value
def
convert_extent
(
self
,
clob
,
srid
):
def
convert_extent
(
self
,
clob
):
if
clob
:
# Generally, Oracle returns a polygon for the extent -- however,
# it can return a single point if there's only one Point in the
# table.
ext_geom
=
Geometry
(
clob
.
read
()
,
srid
)
ext_geom
=
Geometry
(
clob
.
read
())
gtype
=
str
(
ext_geom
.
geom_type
)
if
gtype
==
'Polygon'
:
# Construct the 4-tuple from the coordinates in the polygon.
...
...
django/contrib/gis/db/backends/postgis/operations.py
Dosyayı görüntüle @
08972528
...
...
@@ -206,7 +206,7 @@ class PostGISOperations(BaseSpatialOperations, DatabaseOperations):
version
=
vtup
[
1
:]
return
version
def
convert_extent
(
self
,
box
,
srid
):
def
convert_extent
(
self
,
box
):
"""
Return a 4-tuple extent for the `Extent` aggregate by converting
the bounding box text returned by PostGIS (`box` argument), for
...
...
@@ -219,7 +219,7 @@ class PostGISOperations(BaseSpatialOperations, DatabaseOperations):
xmax
,
ymax
=
map
(
float
,
ur
.
split
())
return
(
xmin
,
ymin
,
xmax
,
ymax
)
def
convert_extent3d
(
self
,
box3d
,
srid
):
def
convert_extent3d
(
self
,
box3d
):
"""
Return a 6-tuple extent for the `Extent3D` aggregate by converting
the 3d bounding-box text returned by PostGIS (`box3d` argument), for
...
...
django/contrib/gis/db/backends/spatialite/operations.py
Dosyayı görüntüle @
08972528
...
...
@@ -113,13 +113,13 @@ class SpatiaLiteOperations(BaseSpatialOperations, DatabaseOperations):
raise
ImproperlyConfigured
(
'GeoDjango only supports SpatiaLite versions 4.0.0 and above.'
)
return
version
def
convert_extent
(
self
,
box
,
srid
):
def
convert_extent
(
self
,
box
):
"""
Convert the polygon data received from SpatiaLite to min/max values.
"""
if
box
is
None
:
return
None
shell
=
Geometry
(
box
,
srid
)
.
shell
shell
=
Geometry
(
box
)
.
shell
xmin
,
ymin
=
shell
[
0
][:
2
]
xmax
,
ymax
=
shell
[
2
][:
2
]
return
(
xmin
,
ymin
,
xmax
,
ymax
)
...
...
@@ -242,16 +242,3 @@ class SpatiaLiteOperations(BaseSpatialOperations, DatabaseOperations):
def
spatial_ref_sys
(
self
):
from
django.contrib.gis.db.backends.spatialite.models
import
SpatialiteSpatialRefSys
return
SpatialiteSpatialRefSys
def
get_db_converters
(
self
,
expression
):
converters
=
super
()
.
get_db_converters
(
expression
)
if
hasattr
(
expression
.
output_field
,
'geom_type'
):
converters
.
append
(
self
.
convert_geometry
)
return
converters
def
convert_geometry
(
self
,
value
,
expression
,
connection
,
context
):
if
value
:
value
=
Geometry
(
value
)
if
'transformed_srid'
in
context
:
value
.
srid
=
context
[
'transformed_srid'
]
return
value
django/contrib/gis/db/models/aggregates.py
Dosyayı görüntüle @
08972528
...
...
@@ -43,7 +43,7 @@ class Extent(GeoAggregate):
super
()
.
__init__
(
expression
,
output_field
=
ExtentField
(),
**
extra
)
def
convert_value
(
self
,
value
,
expression
,
connection
,
context
):
return
connection
.
ops
.
convert_extent
(
value
,
context
.
get
(
'transformed_srid'
)
)
return
connection
.
ops
.
convert_extent
(
value
)
class
Extent3D
(
GeoAggregate
):
...
...
@@ -54,7 +54,7 @@ class Extent3D(GeoAggregate):
super
()
.
__init__
(
expression
,
output_field
=
ExtentField
(),
**
extra
)
def
convert_value
(
self
,
value
,
expression
,
connection
,
context
):
return
connection
.
ops
.
convert_extent3d
(
value
,
context
.
get
(
'transformed_srid'
)
)
return
connection
.
ops
.
convert_extent3d
(
value
)
class
MakeLine
(
GeoAggregate
):
...
...
django/contrib/gis/db/models/fields.py
Dosyayı görüntüle @
08972528
...
...
@@ -57,18 +57,12 @@ class GeoSelectFormatMixin:
other fields, return a simple '
%
s' format string.
"""
connection
=
compiler
.
connection
srid
=
compiler
.
query
.
get_context
(
'transformed_srid'
)
if
srid
:
sel_fmt
=
'
%
s(
%%
s,
%
s)'
%
(
connection
.
ops
.
transform
,
srid
)
else
:
sel_fmt
=
'
%
s'
if
connection
.
ops
.
select
:
# This allows operations to be done on fields in the SELECT,
# overriding their values -- used by the Oracle and MySQL
# spatial backends to get database values as WKT, and by the
# `transform` method.
sel_fmt
=
connection
.
ops
.
select
%
sel_fmt
return
sel_fmt
%
sql
,
params
# spatial backends to get database values as WKT.
sql
=
connection
.
ops
.
select
%
sql
return
sql
,
params
class
BaseSpatialField
(
Field
):
...
...
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