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
f86b6f35
Kaydet (Commit)
f86b6f35
authored
Tem 12, 2017
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #25588 -- Removed obsolete bits of RasterField support.
Unused since
bbfad84d
.
üst
3b56f219
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
33 deletions
+2
-33
operations.py
django/contrib/gis/db/backends/postgis/operations.py
+2
-10
pgraster.py
django/contrib/gis/db/backends/postgis/pgraster.py
+0
-16
fields.py
django/contrib/gis/db/models/fields.py
+0
-7
No files found.
django/contrib/gis/db/backends/postgis/operations.py
Dosyayı görüntüle @
f86b6f35
...
...
@@ -15,7 +15,7 @@ from django.utils.version import get_version_tuple
from
.adapter
import
PostGISAdapter
from
.models
import
PostGISGeometryColumns
,
PostGISSpatialRefSys
from
.pgraster
import
from_pgraster
,
get_pgraster_srid
,
to_pgraster
from
.pgraster
import
from_pgraster
# Identifier to mark raster lookups as bilateral.
BILATERAL
=
'bilateral'
...
...
@@ -297,8 +297,6 @@ class PostGISOperations(BaseSpatialOperations, DatabaseOperations):
# Get the srid for this object
if
value
is
None
:
value_srid
=
None
elif
f
.
geom_type
==
'RASTER'
and
isinstance
(
value
,
str
):
value_srid
=
get_pgraster_srid
(
value
)
else
:
value_srid
=
value
.
srid
...
...
@@ -306,8 +304,6 @@ class PostGISOperations(BaseSpatialOperations, DatabaseOperations):
# is not equal to the field srid.
if
value_srid
is
None
or
value_srid
==
f
.
srid
:
placeholder
=
'
%
s'
elif
f
.
geom_type
==
'RASTER'
and
isinstance
(
value
,
str
):
placeholder
=
'
%
s((
%%
s)::raster,
%
s)'
%
(
tranform_func
,
f
.
srid
)
else
:
placeholder
=
'
%
s(
%%
s,
%
s)'
%
(
tranform_func
,
f
.
srid
)
...
...
@@ -376,10 +372,6 @@ class PostGISOperations(BaseSpatialOperations, DatabaseOperations):
def
spatial_ref_sys
(
self
):
return
PostGISSpatialRefSys
# Methods to convert between PostGIS rasters and dicts that are
# readable by GDALRaster.
def
parse_raster
(
self
,
value
):
"""Convert a PostGIS HEX String into a dict readable by GDALRaster."""
return
from_pgraster
(
value
)
def
deconstruct_raster
(
self
,
value
):
return
to_pgraster
(
value
)
django/contrib/gis/db/backends/postgis/pgraster.py
Dosyayı görüntüle @
f86b6f35
...
...
@@ -30,18 +30,6 @@ def chunk(data, index):
return
data
[:
index
],
data
[
index
:]
def
get_pgraster_srid
(
data
):
"""
Extract the SRID from a PostGIS raster string.
"""
if
data
is
None
:
return
# The positional arguments here extract the hex-encoded srid from the
# header of the PostGIS raster string. This can be understood through
# the POSTGIS_HEADER_STRUCTURE constant definition in the const module.
return
unpack
(
'i'
,
data
[
106
:
114
])[
0
]
def
from_pgraster
(
data
):
"""
Convert a PostGIS HEX String into a dictionary.
...
...
@@ -112,10 +100,6 @@ def to_pgraster(rast):
"""
Convert a GDALRaster into PostGIS Raster format.
"""
# Return if the raster is null
if
rast
is
None
or
rast
==
''
:
return
# Prepare the raster header data as a tuple. The first two numbers are
# the endianness and the PostGIS Raster Version, both are fixed by
# PostGIS at the moment.
...
...
django/contrib/gis/db/models/fields.py
Dosyayı görüntüle @
f86b6f35
...
...
@@ -361,13 +361,6 @@ class RasterField(BaseSpatialField):
def
from_db_value
(
self
,
value
,
expression
,
connection
,
context
):
return
connection
.
ops
.
parse_raster
(
value
)
def
get_db_prep_value
(
self
,
value
,
connection
,
prepared
=
False
):
self
.
_check_connection
(
connection
)
# Prepare raster for writing to database.
if
not
prepared
:
value
=
connection
.
ops
.
deconstruct_raster
(
value
)
return
super
()
.
get_db_prep_value
(
value
,
connection
,
prepared
)
def
contribute_to_class
(
self
,
cls
,
name
,
**
kwargs
):
super
()
.
contribute_to_class
(
cls
,
name
,
**
kwargs
)
# Setup for lazy-instantiated Raster object. For large querysets, the
...
...
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