當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python Django OGRGeomType用法及代碼示例

本文介紹 django.contrib.gis.gdal.OGRGeomType 的用法。

聲明

class OGRGeomType(type_input)

此類允許以多種方式中的任何一種表示 OGR 幾何類型:

>>> from django.contrib.gis.gdal import OGRGeomType
>>> gt1 = OGRGeomType(3)             # Using an integer for the type
>>> gt2 = OGRGeomType('Polygon')     # Using a string
>>> gt3 = OGRGeomType('POLYGON')     # It's case-insensitive
>>> print(gt1 == 3, gt1 == 'Polygon') # Equivalence works w/non-OGRGeomType objects
True True

相關用法


注:本文由純淨天空篩選整理自djangoproject.com大神的英文原創作品 django.contrib.gis.gdal.OGRGeomType。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。