本文整理匯總了Python中django.contrib.gis.geos.libgeos.CS_PTR屬性的典型用法代碼示例。如果您正苦於以下問題:Python libgeos.CS_PTR屬性的具體用法?Python libgeos.CS_PTR怎麽用?Python libgeos.CS_PTR使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類django.contrib.gis.geos.libgeos
的用法示例。
在下文中一共展示了libgeos.CS_PTR屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: cs_operation
# 需要導入模塊: from django.contrib.gis.geos import libgeos [as 別名]
# 或者: from django.contrib.gis.geos.libgeos import CS_PTR [as 別名]
def cs_operation(func, ordinate=False, get=False):
"For coordinate sequence operations."
if get:
# Get routines get double parameter passed-in by reference.
func.errcheck = check_cs_get
dbl_param = POINTER(c_double)
else:
func.errcheck = check_cs_op
dbl_param = c_double
if ordinate:
# Get/Set ordinate routines have an extra uint parameter.
func.argtypes = [CS_PTR, c_uint, c_uint, dbl_param]
else:
func.argtypes = [CS_PTR, c_uint, dbl_param]
func.restype = c_int
return func
示例2: get_func
# 需要導入模塊: from django.contrib.gis.geos import libgeos [as 別名]
# 或者: from django.contrib.gis.geos.libgeos import CS_PTR [as 別名]
def get_func(self, ordinate=False, get=False):
if get:
# Get routines have double parameter passed-in by reference.
self.errcheck = check_cs_get
dbl_param = POINTER(c_double)
else:
self.errcheck = check_cs_op
dbl_param = c_double
if ordinate:
# Get/Set ordinate routines have an extra uint parameter.
self.argtypes = [CS_PTR, c_uint, c_uint, dbl_param]
else:
self.argtypes = [CS_PTR, c_uint, dbl_param]
return super(CsOperation, self).get_func()
示例3: __init__
# 需要導入模塊: from django.contrib.gis.geos import libgeos [as 別名]
# 或者: from django.contrib.gis.geos.libgeos import CS_PTR [as 別名]
def __init__(self, ptr, z=False):
"Initializes from a GEOS pointer."
if not isinstance(ptr, CS_PTR):
raise TypeError('Coordinate sequence should initialize with a CS_PTR.')
self._ptr = ptr
self._z = z
示例4: cs_int
# 需要導入模塊: from django.contrib.gis.geos import libgeos [as 別名]
# 或者: from django.contrib.gis.geos.libgeos import CS_PTR [as 別名]
def cs_int(func):
"For coordinate sequence routines that return an integer."
func.argtypes = [CS_PTR, POINTER(c_uint)]
func.restype = c_int
func.errcheck = check_cs_get
return func
示例5: cs_output
# 需要導入模塊: from django.contrib.gis.geos import libgeos [as 別名]
# 或者: from django.contrib.gis.geos.libgeos import CS_PTR [as 別名]
def cs_output(func, argtypes):
"For routines that return a coordinate sequence."
func.argtypes = argtypes
func.restype = CS_PTR
func.errcheck = check_cs_ptr
return func
# ## Coordinate Sequence ctypes prototypes ##
# Coordinate Sequence constructors & cloning.
示例6: cs_output
# 需要導入模塊: from django.contrib.gis.geos import libgeos [as 別名]
# 或者: from django.contrib.gis.geos.libgeos import CS_PTR [as 別名]
def cs_output(func, argtypes):
"For routines that return a coordinate sequence."
func.argtypes = argtypes
func.restype = CS_PTR
func.errcheck = check_cs_ptr
return func
## Coordinate Sequence ctypes prototypes ##
# Coordinate Sequence constructors & cloning.