當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。