本文介紹 django.contrib.gis.geos.WKTWriter.precision
的用法。
聲明
precision
該屬性控製坐標的舍入精度;如果設置為None
,則禁用舍入。
>>> from django.contrib.gis.geos import Point, WKTWriter
>>> pnt = Point(1.44, 1.66)
>>> wkt_w = WKTWriter()
>>> print(wkt_w.precision)
None
>>> wkt_w.write(pnt)
'POINT (1.4399999999999999 1.6599999999999999)'
>>> wkt_w.precision = 0
>>> wkt_w.write(pnt)
'POINT (1 2)'
>>> wkt_w.precision = 1
>>> wkt_w.write(pnt)
'POINT (1.4 1.7)'
相關用法
- Python Django WKTWriter.trim用法及代碼示例
- Python Django WKTWriter.write用法及代碼示例
- Python Django WKTReader用法及代碼示例
- Python Django WKBWriter.write_hex用法及代碼示例
- Python Django WKBReader用法及代碼示例
- Python Django WKBWriter.byteorder用法及代碼示例
- Python Django WKBWriter.srid用法及代碼示例
- Python Django WKBWriter.outdim用法及代碼示例
- Python Django WKBWriter.write用法及代碼示例
- Python Wand negate()用法及代碼示例
- Python Wand wavelet_denoise()用法及代碼示例
- Python Wand local_contrast()用法及代碼示例
- Python Wand sample()用法及代碼示例
- Python Wand deskew()用法及代碼示例
- Python Wand color()用法及代碼示例
- Python Wand implode()用法及代碼示例
- Python Wand adaptive_blur()用法及代碼示例
- Python Wand unsharp_mask()用法及代碼示例
- Python Wand gaussian_blur()用法及代碼示例
- Python Wand polaroid()用法及代碼示例
- Python Wand adaptive_sharpen()用法及代碼示例
- Python Wand posterize()用法及代碼示例
- Python Wand path_move()用法及代碼示例
- Python Wand transform()用法及代碼示例
- Python Wand shave()用法及代碼示例
注:本文由純淨天空篩選整理自djangoproject.com大神的英文原創作品 django.contrib.gis.geos.WKTWriter.precision。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。