Ejemplo n.º 1
0
Archivo: layer.py Proyecto: 01-/django
 def field_widths(self):
     "Returns a list of the maximum field widths for the features."
     return [capi.get_field_width(capi.get_field_defn(self._ldefn, i))
             for i in range(self.num_fields)]
Ejemplo n.º 2
0
 def width(self):
     "Returns the width of this Field."
     return capi.get_field_width(self.ptr)
Ejemplo n.º 3
0
 def field_widths(self):
     "Returns a list of the maximum field widths for the features."
     return [
         capi.get_field_width(capi.get_field_defn(self._ldefn, i))
         for i in xrange(self.num_fields)
     ]
Ejemplo n.º 4
0
 def width(self):
     "Returns the width of this Field."
     return get_field_width(self._ptr)
Ejemplo n.º 5
0
 def width(self):
     "Return the width of this Field."
     return capi.get_field_width(self.ptr)
Ejemplo n.º 6
0
 def width(self):
     "Returns the width of this Field."
     return get_field_width(self._ptr)
Ejemplo n.º 7
0
<<<<<<< HEAD
        "Returns the value of this Field."
=======
        "Return the value of this Field."
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435
        # Default is to get the field as a string.
        return self.as_string()

    @property
    def width(self):
<<<<<<< HEAD
        "Returns the width of this Field."
=======
        "Return the width of this Field."
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435
        return capi.get_field_width(self.ptr)


# ### The Field sub-classes for each OGR Field type. ###
class OFTInteger(Field):
    _double = False
    _bit64 = False

    @property
    def value(self):
<<<<<<< HEAD
        "Returns an integer contained in this field."
=======
        "Return an integer contained in this field."
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435
        if self._double:
Ejemplo n.º 8
0
        Return a list of the types of fields in this Layer.  For example,
        return the list [OFTInteger, OFTReal, OFTString] for an OGR layer that
        has an integer, a floating-point, and string fields.
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435
        """
        return [OGRFieldTypes[capi.get_field_type(capi.get_field_defn(self._ldefn, i))]
                for i in range(self.num_fields)]

    @property
    def field_widths(self):
<<<<<<< HEAD
        "Returns a list of the maximum field widths for the features."
=======
        "Return a list of the maximum field widths for the features."
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435
        return [capi.get_field_width(capi.get_field_defn(self._ldefn, i))
                for i in range(self.num_fields)]

    @property
    def field_precisions(self):
<<<<<<< HEAD
        "Returns the field precisions for the features."
=======
        "Return the field precisions for the features."
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435
        return [capi.get_field_precision(capi.get_field_defn(self._ldefn, i))
                for i in range(self.num_fields)]

    def _get_spatial_filter(self):
        try:
            return OGRGeometry(geom_api.clone_geom(capi.get_spatial_filter(self.ptr)))
Ejemplo n.º 9
0
from ctypes import byref, c_int
Ejemplo n.º 10
0
from ctypes import byref, c_double