當前位置: 首頁>>代碼示例>>Python>>正文


Python polygon.Polygon方法代碼示例

本文整理匯總了Python中django.contrib.gis.geos.polygon.Polygon方法的典型用法代碼示例。如果您正苦於以下問題:Python polygon.Polygon方法的具體用法?Python polygon.Polygon怎麽用?Python polygon.Polygon使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在django.contrib.gis.geos.polygon的用法示例。


在下文中一共展示了polygon.Polygon方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: length

# 需要導入模塊: from django.contrib.gis.geos import polygon [as 別名]
# 或者: from django.contrib.gis.geos.polygon import Polygon [as 別名]
def length(self):
        """
        Returns the length of this Geometry (e.g., 0 for point, or the
        circumfrence of a Polygon).
        """
        return capi.geos_length(self.ptr, byref(c_double())) 
開發者ID:VirtualPlants,項目名稱:tissuelab,代碼行數:8,代碼來源:geometry.py

示例2: write

# 需要導入模塊: from django.contrib.gis.geos import polygon [as 別名]
# 或者: from django.contrib.gis.geos.polygon import Polygon [as 別名]
def write(self, geom):
        "Returns the WKB representation of the given geometry."
        from django.contrib.gis.geos import Polygon
        geom = self._handle_empty_point(geom)
        wkb = wkb_writer_write(self.ptr, geom.ptr, byref(c_size_t()))
        if isinstance(geom, Polygon) and geom.empty:
            # Fix GEOS output for empty polygon.
            # See https://trac.osgeo.org/geos/ticket/680.
            wkb = wkb[:-8] + b'\0' * 4
        return six.memoryview(wkb) 
開發者ID:prakharchoudhary,項目名稱:Scrum,代碼行數:12,代碼來源:io.py

示例3: write_hex

# 需要導入模塊: from django.contrib.gis.geos import polygon [as 別名]
# 或者: from django.contrib.gis.geos.polygon import Polygon [as 別名]
def write_hex(self, geom):
        "Returns the HEXEWKB representation of the given geometry."
        from django.contrib.gis.geos.polygon import Polygon
        geom = self._handle_empty_point(geom)
        wkb = wkb_writer_write_hex(self.ptr, geom.ptr, byref(c_size_t()))
        if isinstance(geom, Polygon) and geom.empty:
            wkb = wkb[:-16] + b'0' * 8
        return wkb

    # ### WKBWriter Properties ###

    # Property for getting/setting the byteorder. 
開發者ID:prakharchoudhary,項目名稱:Scrum,代碼行數:14,代碼來源:io.py

示例4: _post_init

# 需要導入模塊: from django.contrib.gis.geos import polygon [as 別名]
# 或者: from django.contrib.gis.geos.polygon import Polygon [as 別名]
def _post_init(self, srid):
        "Helper routine for performing post-initialization setup."
        # Setting the SRID, if given.
        if srid and isinstance(srid, int): self.srid = srid

        # Setting the class type (e.g., Point, Polygon, etc.)
        self.__class__ = GEOS_CLASSES[self.geom_typeid]

        # Setting the coordinate sequence for the geometry (will be None on
        # geometries that do not have coordinate sequences)
        self._set_cs() 
開發者ID:VirtualPlants,項目名稱:tissuelab,代碼行數:13,代碼來源:geometry.py

示例5: geom_type

# 需要導入模塊: from django.contrib.gis.geos import polygon [as 別名]
# 或者: from django.contrib.gis.geos.polygon import Polygon [as 別名]
def geom_type(self):
        "Returns a string representing the Geometry type, e.g. 'Polygon'"
        return capi.geos_type(self.ptr).decode() 
開發者ID:VirtualPlants,項目名稱:tissuelab,代碼行數:5,代碼來源:geometry.py

示例6: convex_hull

# 需要導入模塊: from django.contrib.gis.geos import polygon [as 別名]
# 或者: from django.contrib.gis.geos.polygon import Polygon [as 別名]
def convex_hull(self):
        """
        Returns the smallest convex Polygon that contains all the points
        in the Geometry.
        """
        return self._topology(capi.geos_convexhull(self.ptr)) 
開發者ID:VirtualPlants,項目名稱:tissuelab,代碼行數:8,代碼來源:geometry.py


注:本文中的django.contrib.gis.geos.polygon.Polygon方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。