Exemplo n.º 1
0
 def field_precisions(self):
     "Returns the field precisions for the features."
     return [
         capi.get_field_precision(capi.get_field_defn(self._ldefn, i))
         for i in xrange(self.num_fields)
     ]
Exemplo n.º 2
0
Arquivo: layer.py Projeto: 01-/django
 def field_precisions(self):
     "Returns the field precisions for the features."
     return [capi.get_field_precision(capi.get_field_defn(self._ldefn, i))
             for i in range(self.num_fields)]
Exemplo n.º 3
0
 def precision(self):
     "Return the precision of this Field."
     return capi.get_field_precision(self.ptr)
Exemplo n.º 4
0
 def precision(self):
     "Returns the precision of this Field."
     return capi.get_field_precision(self.ptr)
Exemplo n.º 5
0
 def precision(self):
     "Returns the precision of this Field."
     return get_field_precision(self._ptr)
Exemplo n.º 6
0
<<<<<<< HEAD
        "Returns the name of this Field."
=======
        "Return the name of this Field."
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435
        name = capi.get_field_name(self.ptr)
        return force_text(name, encoding=self._feat.encoding, strings_only=True)

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

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

    @property
    def type_name(self):
        "Return the OGR field type name for this Field."
        return capi.get_field_type_name(self.type)
Exemplo n.º 7
0
<<<<<<< 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)))
        except GDALException:
            return None

    def _set_spatial_filter(self, filter):
        if isinstance(filter, OGRGeometry):
            capi.set_spatial_filter(self.ptr, filter.ptr)
        elif isinstance(filter, (tuple, list)):
            if not len(filter) == 4:
                raise ValueError('Spatial filter list/tuple must have 4 elements.')
            # Map c_double onto params -- if a bad type is passed in it
Exemplo n.º 8
0
from ctypes import byref, c_int
Exemplo n.º 9
0
from ctypes import byref, c_double