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
e494b9ff
Kaydet (Commit)
e494b9ff
authored
Nis 16, 2016
tarafından
krishbharadwaj
Kaydeden (comit)
Tim Graham
Nis 16, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #26509 -- Deprecated the contrib.gis.utils.precision_wkt() function.
üst
a3265af8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
0 deletions
+38
-0
wkt.py
django/contrib/gis/utils/wkt.py
+7
-0
deprecation.txt
docs/internals/deprecation.txt
+2
-0
1.10.txt
docs/releases/1.10.txt
+3
-0
test_wkt.py
tests/gis_tests/test_wkt.py
+26
-0
No files found.
django/contrib/gis/utils/wkt.py
Dosyayı görüntüle @
e494b9ff
"""
Utilities for manipulating Geometry WKT.
"""
import
warnings
from
django.utils
import
six
from
django.utils.deprecation
import
RemovedInDjango20Warning
def
precision_wkt
(
geom
,
prec
):
...
...
@@ -21,6 +23,11 @@ def precision_wkt(geom, prec):
If the precision is a string, it must be valid Python format string
(e.g., '
%20.7
f') -- thus, you should know what you're doing.
"""
warnings
.
warn
(
"precision_wkt() is deprecated in favor of the WKTWriter class."
,
RemovedInDjango20Warning
,
stacklevel
=
2
)
if
isinstance
(
prec
,
int
):
num_fmt
=
'
%%
.
%
df'
%
prec
elif
isinstance
(
prec
,
six
.
string_types
):
...
...
docs/internals/deprecation.txt
Dosyayı görüntüle @
e494b9ff
...
...
@@ -158,6 +158,8 @@ details on these changes.
* The ``javascript_catalog()`` and ``json_catalog()`` views will be removed.
* The ``django.contrib.gis.utils.precision_wkt()`` function will be removed.
.. _deprecation-removed-in-1.10:
1.10
...
...
docs/releases/1.10.txt
Dosyayı görüntüle @
e494b9ff
...
...
@@ -796,6 +796,9 @@ wish to support earlier versions of Django.
:class:`~django.contrib.gis.geos.MultiPolygon` is deprecated in favor of the
:attr:`~django.contrib.gis.geos.GEOSGeometry.unary_union` property.
* The ``django.contrib.gis.utils.precision_wkt()`` function is deprecated in
favor of :class:`~django.contrib.gis.geos.WKTWriter`.
``CommaSeparatedIntegerField`` model field
------------------------------------------
...
...
tests/gis_tests/test_wkt.py
0 → 100644
Dosyayı görüntüle @
e494b9ff
from
unittest
import
skipUnless
from
django.contrib.gis.geos
import
HAS_GEOS
,
GEOSGeometry
from
django.contrib.gis.utils.wkt
import
precision_wkt
from
django.test
import
SimpleTestCase
,
ignore_warnings
from
django.utils.deprecation
import
RemovedInDjango20Warning
@skipUnless
(
HAS_GEOS
,
"Requires GEOS support"
)
class
WktTest
(
SimpleTestCase
):
@ignore_warnings
(
category
=
RemovedInDjango20Warning
)
def
test_wkt
(
self
):
point
=
GEOSGeometry
(
'POINT (951640.547328465 4219369.26171664)'
)
self
.
assertEqual
(
'POINT(951640.547328 4219369.261717)'
,
precision_wkt
(
point
,
6
))
self
.
assertEqual
(
'POINT(951640.5473 4219369.2617)'
,
precision_wkt
(
point
,
'
%.4
f'
))
multipoint
=
GEOSGeometry
(
"SRID=4326;MULTIPOINT((13.18634033203125 14.504356384277344),"
"(13.207969665527 14.490966796875),(13.177070617675 14.454917907714))"
)
self
.
assertEqual
(
"MULTIPOINT(13.186340332031 14.504356384277,"
"13.207969665527 14.490966796875,13.177070617675 14.454917907714)"
,
precision_wkt
(
multipoint
,
12
)
)
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