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
0dbe897a
Kaydet (Commit)
0dbe897a
authored
Eki 21, 2015
tarafından
Sergey Fedoseev
Kaydeden (comit)
Tim Graham
Eki 21, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #25585 -- Allowed setting OGRGeometry srid/srs attributes to `None`.
üst
80855a4b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
geometries.py
django/contrib/gis/gdal/geometries.py
+3
-1
test_geom.py
tests/gis_tests/gdal_tests/test_geom.py
+5
-0
No files found.
django/contrib/gis/gdal/geometries.py
Dosyayı görüntüle @
0dbe897a
...
@@ -270,6 +270,8 @@ class OGRGeometry(GDALBase):
...
@@ -270,6 +270,8 @@ class OGRGeometry(GDALBase):
elif
isinstance
(
srs
,
six
.
integer_types
+
six
.
string_types
):
elif
isinstance
(
srs
,
six
.
integer_types
+
six
.
string_types
):
sr
=
SpatialReference
(
srs
)
sr
=
SpatialReference
(
srs
)
srs_ptr
=
sr
.
ptr
srs_ptr
=
sr
.
ptr
elif
srs
is
None
:
srs_ptr
=
None
else
:
else
:
raise
TypeError
(
'Cannot assign spatial reference with object of type:
%
s'
%
type
(
srs
))
raise
TypeError
(
'Cannot assign spatial reference with object of type:
%
s'
%
type
(
srs
))
capi
.
assign_srs
(
self
.
ptr
,
srs_ptr
)
capi
.
assign_srs
(
self
.
ptr
,
srs_ptr
)
...
@@ -284,7 +286,7 @@ class OGRGeometry(GDALBase):
...
@@ -284,7 +286,7 @@ class OGRGeometry(GDALBase):
return
None
return
None
def
_set_srid
(
self
,
srid
):
def
_set_srid
(
self
,
srid
):
if
isinstance
(
srid
,
six
.
integer_types
):
if
isinstance
(
srid
,
six
.
integer_types
)
or
srid
is
None
:
self
.
srs
=
srid
self
.
srs
=
srid
else
:
else
:
raise
TypeError
(
'SRID must be set with an integer.'
)
raise
TypeError
(
'SRID must be set with an integer.'
)
...
...
tests/gis_tests/gdal_tests/test_geom.py
Dosyayı görüntüle @
0dbe897a
...
@@ -320,6 +320,11 @@ class OGRGeomTest(unittest.TestCase, TestDataMixin):
...
@@ -320,6 +320,11 @@ class OGRGeomTest(unittest.TestCase, TestDataMixin):
self
.
assertEqual
(
'WGS 72'
,
ring
.
srs
.
name
)
self
.
assertEqual
(
'WGS 72'
,
ring
.
srs
.
name
)
self
.
assertEqual
(
4322
,
ring
.
srid
)
self
.
assertEqual
(
4322
,
ring
.
srid
)
# srs/srid may be assigned their own values, even when srs is None.
mpoly
=
OGRGeometry
(
mp
.
wkt
,
srs
=
None
)
mpoly
.
srs
=
mpoly
.
srs
mpoly
.
srid
=
mpoly
.
srid
def
test_srs_transform
(
self
):
def
test_srs_transform
(
self
):
"Testing transform()."
"Testing transform()."
orig
=
OGRGeometry
(
'POINT (-104.609 38.255)'
,
4326
)
orig
=
OGRGeometry
(
'POINT (-104.609 38.255)'
,
4326
)
...
...
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