当前位置: 首页>>代码示例>>Python>>正文


Python libgeos.GEOM_PTR属性代码示例

本文整理汇总了Python中django.contrib.gis.geos.libgeos.GEOM_PTR属性的典型用法代码示例。如果您正苦于以下问题:Python libgeos.GEOM_PTR属性的具体用法?Python libgeos.GEOM_PTR怎么用?Python libgeos.GEOM_PTR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在django.contrib.gis.geos.libgeos的用法示例。


在下文中一共展示了libgeos.GEOM_PTR属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _create_polygon

# 需要导入模块: from django.contrib.gis.geos import libgeos [as 别名]
# 或者: from django.contrib.gis.geos.libgeos import GEOM_PTR [as 别名]
def _create_polygon(self, length, items):
        # Instantiate LinearRing objects if necessary, but don't clone them yet
        # _construct_ring will throw a TypeError if a parameter isn't a valid ring
        # If we cloned the pointers here, we wouldn't be able to clean up
        # in case of error.
        rings = []
        for r in items:
            if isinstance(r, GEOM_PTR):
                rings.append(r)
            else:
                rings.append(self._construct_ring(r))

        shell = self._clone(rings.pop(0))

        n_holes = length - 1
        if n_holes:
            holes = get_pointer_arr(n_holes)
            for i, r in enumerate(rings):
                holes[i] = self._clone(r)
                holes_param = byref(holes)
        else:
            holes_param = None

        return capi.create_polygon(shell, holes_param, c_uint(n_holes)) 
开发者ID:ComputerSocietyUNB,项目名称:CodingDojo,代码行数:26,代码来源:polygon.py

示例2: _clone

# 需要导入模块: from django.contrib.gis.geos import libgeos [as 别名]
# 或者: from django.contrib.gis.geos.libgeos import GEOM_PTR [as 别名]
def _clone(self, g):
        if isinstance(g, GEOM_PTR):
            return capi.geom_clone(g)
        else:
            return capi.geom_clone(g.ptr) 
开发者ID:ComputerSocietyUNB,项目名称:CodingDojo,代码行数:7,代码来源:polygon.py

示例3: get_func

# 需要导入模块: from django.contrib.gis.geos import libgeos [as 别名]
# 或者: from django.contrib.gis.geos.libgeos import GEOM_PTR [as 别名]
def get_func(self, num_geom=1):
        argtypes = [GEOM_PTR for i in range(num_geom)]
        argtypes += [POINTER(c_double)]
        self.argtypes = argtypes
        return super(DblFromGeom, self).get_func()


# ### ctypes prototypes ###

# Area, distance, and length prototypes. 
开发者ID:ComputerSocietyUNB,项目名称:CodingDojo,代码行数:12,代码来源:misc.py

示例4: _create_polygon

# 需要导入模块: from django.contrib.gis.geos import libgeos [as 别名]
# 或者: from django.contrib.gis.geos.libgeos import GEOM_PTR [as 别名]
def _create_polygon(self, length, items):
        # Instantiate LinearRing objects if necessary, but don't clone them yet
        # _construct_ring will throw a TypeError if a parameter isn't a valid ring
        # If we cloned the pointers here, we wouldn't be able to clean up
        # in case of error.
        if not length:
            return capi.create_empty_polygon()

        rings = []
        for r in items:
            if isinstance(r, GEOM_PTR):
                rings.append(r)
            else:
                rings.append(self._construct_ring(r))

        shell = self._clone(rings.pop(0))

        n_holes = length - 1
        if n_holes:
            holes = get_pointer_arr(n_holes)
            for i, r in enumerate(rings):
                holes[i] = self._clone(r)
                holes_param = byref(holes)
        else:
            holes_param = None

        return capi.create_polygon(shell, holes_param, c_uint(n_holes)) 
开发者ID:KimJangHyeon,项目名称:NarshaTech,代码行数:29,代码来源:polygon.py

示例5: binary_predicate

# 需要导入模块: from django.contrib.gis.geos import libgeos [as 别名]
# 或者: from django.contrib.gis.geos.libgeos import GEOM_PTR [as 别名]
def binary_predicate(func, *args):
    "For GEOS binary predicate functions."
    argtypes = [GEOM_PTR, GEOM_PTR]
    if args:
        argtypes += args
    func.argtypes = argtypes
    func.restype = c_char
    func.errcheck = check_predicate
    return func 
开发者ID:0daybug,项目名称:DjangoBlog,代码行数:11,代码来源:predicates.py

示例6: unary_predicate

# 需要导入模块: from django.contrib.gis.geos import libgeos [as 别名]
# 或者: from django.contrib.gis.geos.libgeos import GEOM_PTR [as 别名]
def unary_predicate(func):
    "For GEOS unary predicate functions."
    func.argtypes = [GEOM_PTR]
    func.restype = c_char
    func.errcheck = check_predicate
    return func

# ## Unary Predicates ## 
开发者ID:0daybug,项目名称:DjangoBlog,代码行数:10,代码来源:predicates.py

示例7: bin_output

# 需要导入模块: from django.contrib.gis.geos import libgeos [as 别名]
# 或者: from django.contrib.gis.geos.libgeos import GEOM_PTR [as 别名]
def bin_output(func):
    "Generates a prototype for the routines that return a sized string."
    func.argtypes = [GEOM_PTR, POINTER(c_size_t)]
    func.errcheck = check_sized_string
    func.restype = c_uchar_p
    return func 
开发者ID:0daybug,项目名称:DjangoBlog,代码行数:8,代码来源:geom.py

示例8: geom_output

# 需要导入模块: from django.contrib.gis.geos import libgeos [as 别名]
# 或者: from django.contrib.gis.geos.libgeos import GEOM_PTR [as 别名]
def geom_output(func, argtypes):
    "For GEOS routines that return a geometry."
    if argtypes:
        func.argtypes = argtypes
    func.restype = GEOM_PTR
    func.errcheck = check_geom
    return func 
开发者ID:0daybug,项目名称:DjangoBlog,代码行数:9,代码来源:geom.py

示例9: geom_index

# 需要导入模块: from django.contrib.gis.geos import libgeos [as 别名]
# 或者: from django.contrib.gis.geos.libgeos import GEOM_PTR [as 别名]
def geom_index(func):
    "For GEOS routines that return geometries from an index."
    return geom_output(func, [GEOM_PTR, c_int]) 
开发者ID:0daybug,项目名称:DjangoBlog,代码行数:5,代码来源:geom.py

示例10: int_from_geom

# 需要导入模块: from django.contrib.gis.geos import libgeos [as 别名]
# 或者: from django.contrib.gis.geos.libgeos import GEOM_PTR [as 别名]
def int_from_geom(func, zero=False):
    "Argument is a geometry, return type is an integer."
    func.argtypes = [GEOM_PTR]
    func.restype = c_int
    if zero:
        func.errcheck = check_zero
    else:
        func.errcheck = check_minus_one
    return func 
开发者ID:0daybug,项目名称:DjangoBlog,代码行数:11,代码来源:geom.py

示例11: string_from_geom

# 需要导入模块: from django.contrib.gis.geos import libgeos [as 别名]
# 或者: from django.contrib.gis.geos.libgeos import GEOM_PTR [as 别名]
def string_from_geom(func):
    "Argument is a Geometry, return type is a string."
    func.argtypes = [GEOM_PTR]
    func.restype = geos_char_p
    func.errcheck = check_string
    return func

# ### ctypes prototypes ###

# Deprecated creation routines from WKB, HEX, WKT 
开发者ID:0daybug,项目名称:DjangoBlog,代码行数:12,代码来源:geom.py

示例12: wkb_write_func

# 需要导入模块: from django.contrib.gis.geos import libgeos [as 别名]
# 或者: from django.contrib.gis.geos.libgeos import GEOM_PTR [as 别名]
def wkb_write_func(func):
    func.argtypes = [WKB_WRITE_PTR, GEOM_PTR, POINTER(c_size_t)]
    func.restype = c_uchar_p
    func.errcheck = check_sized_string
    return func 
开发者ID:0daybug,项目名称:DjangoBlog,代码行数:7,代码来源:io.py

示例13: topology

# 需要导入模块: from django.contrib.gis.geos import libgeos [as 别名]
# 或者: from django.contrib.gis.geos.libgeos import GEOM_PTR [as 别名]
def topology(func, *args, **kwargs):
    "For GEOS unary topology functions."
    argtypes = [GEOM_PTR]
    if args:
        argtypes += args
    func.argtypes = argtypes
    func.restype = kwargs.get('restype', GEOM_PTR)
    func.errcheck = kwargs.get('errcheck', check_geom)
    return func

# Topology Routines 
开发者ID:0daybug,项目名称:DjangoBlog,代码行数:13,代码来源:topology.py

示例14: dbl_from_geom

# 需要导入模块: from django.contrib.gis.geos import libgeos [as 别名]
# 或者: from django.contrib.gis.geos.libgeos import GEOM_PTR [as 别名]
def dbl_from_geom(func, num_geom=1):
    """
    Argument is a Geometry, return type is double that is passed
    in by reference as the last argument.
    """
    argtypes = [GEOM_PTR for i in range(num_geom)]
    argtypes += [POINTER(c_double)]
    func.argtypes = argtypes
    func.restype = c_int  # Status code returned
    func.errcheck = check_dbl
    return func

# ### ctypes prototypes ###

# Area, distance, and length prototypes. 
开发者ID:0daybug,项目名称:DjangoBlog,代码行数:17,代码来源:misc.py


注:本文中的django.contrib.gis.geos.libgeos.GEOM_PTR属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。