• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(625)  |  Call(385)  |  Derive(0)  |  Import(240)
No Document.

src/p/y/py_examples-HEAD/opencv/CVtypes.py   py_examples(Download)
 
import ctypes, os
from ctypes import Structure, Union, POINTER, SetPointerType, CFUNCTYPE, cdll, byref
from ctypes import c_char_p, c_double, c_float, c_byte, c_ubyte, c_int, c_void_p, c_ulong
from ctypes import c_uint32, c_short, c_char, c_longlong
 
# ----Load the DLLs ----------------------------------------------------------

src/s/h/shapely-3k-HEAD/shapely/geometry/point.py   shapely-3k(Download)
"""
Points.
"""
 
from ctypes import string_at, create_string_buffer, \
    c_char_p, c_double, c_float, c_int, c_uint, c_size_t, c_ubyte, \
    c_void_p, byref
 
        cdata = array['data'][0]
        cp = cast(cdata, POINTER(c_double))
        dx = c_double(cp[0])
        dy = c_double(cp[1])
        dz = None
        if n == 3:
            dz = c_double(cp[2])
        else:
            coords = ob
        n = len(coords)
        dx = c_double(coords[0])
        dy = c_double(coords[1])
        dz = None
        if n == 3:
            dz = c_double(coords[2])
    def x(self):
        """Return x coordinate."""
        cs = lgeos.GEOSGeom_getCoordSeq(self._geom)
        d = c_double()
        lgeos.GEOSCoordSeq_getX(cs, 0, byref(d))
        return d.value
 
    @property
    @exceptNull
    def y(self):
        """Return y coordinate."""
        cs = lgeos.GEOSGeom_getCoordSeq(self._geom)
        d = c_double()
    def z(self):
        """Return z coordinate."""
        if self._ndim != 3:
            raise DimensionError("This point has no z coordinate.")
        cs = lgeos.GEOSGeom_getCoordSeq(self._geom)
        d = c_double()
        lgeos.GEOSCoordSeq_getZ(cs, 0, byref(d))
    def bounds(self):
        cs = lgeos.GEOSGeom_getCoordSeq(self._geom)
        x = c_double()
        y = c_double()
        lgeos.GEOSCoordSeq_getX(cs, 0, byref(x))
        lgeos.GEOSCoordSeq_getY(cs, 0, byref(y))
        return (x.value, y.value, x.value, y.value)

src/s/h/shapely-3k-HEAD/shapely/geometry/linestring.py   shapely-3k(Download)
"""
Line strings.
"""
 
from ctypes import byref, c_double, c_int, cast, POINTER, pointer
from ctypes import ArgumentError
 
 
        # add to coordinate sequence
        for i in range(m):
            dx = c_double(cp[n*i])
            dy = c_double(cp[n*i+1])
            dz = None
            if n == 3:
                try:
                    dz = c_double(cp[n*i+2])
        # add to coordinate sequence
        for i in range(m):
            coords = ob[i]
            dx = c_double(coords[0])
            dy = c_double(coords[1])
            dz = None
            if n == 3:
                try:
                    dz = c_double(coords[2])

src/s/h/shapely-HEAD/shapely/geometry/point.py   shapely(Download)
"""Points and related utilities
"""
 
from ctypes import c_double
from ctypes import cast, POINTER
 
from shapely.geos import lgeos, DimensionError
        if type(da) == type((0,)):
            cdata = da[0]
            cp = cast(cdata, POINTER(c_double))
            dx = c_double(cp[0])
            dy = c_double(cp[1])
            if n == 3:
                dz = c_double(cp[2])
        else:
            coords = ob
        n = len(coords)
        dx = c_double(coords[0])
        dy = c_double(coords[1])
        dz = None
        if n == 3:
            dz = c_double(coords[2])

src/s/h/shapely-3k-HEAD/shapely/geometry/polygon.py   shapely-3k(Download)
"""
Polygons and their linear ring components.
"""
 
from ctypes import byref, c_double, c_int, c_void_p, cast, POINTER, pointer
import weakref
from shapely.geos import lgeos
 
        # add to coordinate sequence
        for i in range(m):
            dx = c_double(cp[n*i])
            dy = c_double(cp[n*i+1])
            dz = None
            if n == 3:
                dz = c_double(cp[n*i+2])
 
        # Add closing coordinates to sequence?
        if M > m:
            dx = c_double(cp[0])
            dy = c_double(cp[1])
            dz = None
            if n == 3:
                dz = c_double(cp[2])
        # add to coordinate sequence
        for i in range(m):
            coords = ob[i]
            dx = c_double(coords[0])
            dy = c_double(coords[1])
            dz = None
            if n == 3:
                dz = c_double(coords[2])
        # Add closing coordinates to sequence?
        if M > m:
            coords = ob[0]
            dx = c_double(coords[0])
            dy = c_double(coords[1])
            dz = None
            if n == 3:
                dz = c_double(coords[2])

src/s/h/shapely-HEAD/shapely/geometry/linestring.py   shapely(Download)
"""Line strings and related utilities
"""
 
from ctypes import c_double, cast, POINTER
from ctypes import ArgumentError
 
from shapely.geos import lgeos
 
        # add to coordinate sequence
        for i in xrange(m):
            dx = c_double(cp[n*i])
            dy = c_double(cp[n*i+1])
            dz = None
            if n == 3:
                try:
                    dz = c_double(cp[n*i+2])
        # add to coordinate sequence
        for i in xrange(m):
            coords = ob[i]
            dx = c_double(coords[0])
            dy = c_double(coords[1])
            dz = None
            if n == 3:
                try:
                    dz = c_double(coords[2])

src/s/h/Shapely-1.2.5/shapely/geometry/point.py   Shapely(Download)
"""Points and related utilities
"""
 
from ctypes import c_double
from ctypes import cast, POINTER
 
from shapely.geos import lgeos, DimensionError
        if type(da) == type((0,)):
            cdata = da[0]
            cp = cast(cdata, POINTER(c_double))
            dx = c_double(cp[0])
            dy = c_double(cp[1])
            if n == 3:
                dz = c_double(cp[2])
        else:
            coords = ob
        n = len(coords)
        dx = c_double(coords[0])
        dy = c_double(coords[1])
        dz = None
        if n == 3:
            dz = c_double(coords[2])

src/s/h/shapely-HEAD/shapely/geometry/polygon.py   shapely(Download)
"""Polygons and their linear ring components
"""
 
from ctypes import c_double, c_void_p, cast, POINTER
from ctypes import ArgumentError
import weakref
from shapely.geos import lgeos
 
        # add to coordinate sequence
        for i in xrange(m):
            dx = c_double(cp[n*i])
            dy = c_double(cp[n*i+1])
            dz = None
            if n == 3:
                dz = c_double(cp[n*i+2])
 
        # Add closing coordinates to sequence?
        if M > m:
            dx = c_double(cp[0])
            dy = c_double(cp[1])
            dz = None
            if n == 3:
                dz = c_double(cp[2])
        # add to coordinate sequence
        for i in xrange(m):
            coords = ob[i]
            dx = c_double(coords[0])
            dy = c_double(coords[1])
            dz = None
            if n == 3:
                dz = c_double(coords[2])
        # Add closing coordinates to sequence?
        if M > m:
            coords = ob[0]
            dx = c_double(coords[0])
            dy = c_double(coords[1])
            dz = None
            if n == 3:
                dz = c_double(coords[2])

src/s/h/shapely-3k-HEAD/shapely/geometry/base.py   shapely-3k(Download)
"""
Base geometry class and utilities.
"""
 
from ctypes import string_at, byref, c_int, c_size_t, c_char_p, c_double
import sys
 
    def __next__(self):
        dx = c_double()
        dy = c_double()
        dz = c_double()
        i = self.index
        if i < self._length:
            lgeos.GEOSCoordSeq_getX(self._cseq, i, byref(dx))
            ii = M + i
        else:
            ii = i
        dx = c_double()
        dy = c_double()
        dz = c_double()
        lgeos.GEOSCoordSeq_getX(self._cseq, ii, byref(dx))
    def ctypes(self):
        self.update_cseq()
        n = self._ndim
        m = self.__len__()
        array_type = c_double * (m * n)
        data = array_type()
        temp = c_double()
    def area(self):
        a = c_double()
        retval =  lgeos.GEOSArea(self._geom, byref(a))
        return a.value
 
    @property
    @exceptNull
    def length(self):
        len = c_double()
    def distance(self, other):
        d = c_double()
        retval =  lgeos.GEOSDistance(self._geom, other._geom, byref(d))
        return d.value
 
    # Topology operations
    #
    def buffer(self, distance, quadsegs=16):
        return geom_factory(
            lgeos.GEOSBuffer(self._geom, c_double(distance), c_int(quadsegs))
            )
 
    # Relate has a unique string return value
    @exceptNull
        maxx = -1e+20
        miny = 1.e+20
        maxy = -1e+20
        temp = c_double()
        for i in range(cs_len.value):
            lgeos.GEOSCoordSeq_getX(cs, i, byref(temp))
            x = temp.value

src/s/h/Shapely-1.2.5/shapely/geometry/linestring.py   Shapely(Download)
"""Line strings and related utilities
"""
 
from ctypes import c_double, cast, POINTER
from ctypes import ArgumentError
 
from shapely.geos import lgeos
 
        # add to coordinate sequence
        for i in xrange(m):
            dx = c_double(cp[n*i])
            dy = c_double(cp[n*i+1])
            dz = None
            if n == 3:
                try:
                    dz = c_double(cp[n*i+2])
        # add to coordinate sequence
        for i in xrange(m):
            coords = ob[i]
            dx = c_double(coords[0])
            dy = c_double(coords[1])
            dz = None
            if n == 3:
                try:
                    dz = c_double(coords[2])

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next