当前位置: 首页>>代码示例>>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;未经允许,请勿转载。