Example #1
0
 def as_datetime(self):
     "Retrieves the Field's value as a tuple of date & time components."
     yy, mm, dd, hh, mn, ss, tz = [c_int() for i in range(7)]
     status = get_field_as_datetime(self._feat, self._index, byref(yy), byref(mm), byref(dd),
                                    byref(hh), byref(mn), byref(ss), byref(tz))
     if status:
         return (yy, mm, dd, hh, mn, ss, tz)
     else:
         raise OGRException('Unable to retrieve date & time information from the field.')
Example #2
0
 def as_datetime(self):
     "Retrieves the Field's value as a tuple of date & time components."
     yy, mm, dd, hh, mn, ss, tz = [c_int() for i in range(7)]
     status = capi.get_field_as_datetime(self._feat, self._index, byref(yy), byref(mm), byref(dd),
                                         byref(hh), byref(mn), byref(ss), byref(tz))
     if status:
         return (yy, mm, dd, hh, mn, ss, tz)
     else:
         raise OGRException('Unable to retrieve date & time information from the field.')
Example #3
0
 def as_datetime(self):
     "Retrieve the Field's value as a tuple of date & time components."
     if not self.is_set:
         return None
     yy, mm, dd, hh, mn, ss, tz = [c_int() for i in range(7)]
     status = capi.get_field_as_datetime(
         self._feat.ptr,
         self._index,
         byref(yy),
         byref(mm),
         byref(dd),
         byref(hh),
         byref(mn),
         byref(ss),
         byref(tz),
     )
     if status:
         return (yy, mm, dd, hh, mn, ss, tz)
     else:
         raise GDALException(
             "Unable to retrieve date & time information from the field.")
Example #4
0
        "Retrieves the Field's value as a string."
=======
        "Retrieve the Field's value as a string."
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435
        string = capi.get_field_as_string(self._feat.ptr, self._index)
        return force_text(string, encoding=self._feat.encoding, strings_only=True)

    def as_datetime(self):
<<<<<<< HEAD
        "Retrieves the Field's value as a tuple of date & time components."
=======
        "Retrieve the Field's value as a tuple of date & time components."
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435
        yy, mm, dd, hh, mn, ss, tz = [c_int() for i in range(7)]
        status = capi.get_field_as_datetime(
            self._feat.ptr, self._index, byref(yy), byref(mm), byref(dd),
            byref(hh), byref(mn), byref(ss), byref(tz))
        if status:
            return (yy, mm, dd, hh, mn, ss, tz)
        else:
            raise GDALException('Unable to retrieve date & time information from the field.')

    # #### Field Properties ####
    @property
    def name(self):
<<<<<<< HEAD
        "Returns the name of this Field."
=======
        "Return the name of this Field."
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435
        name = capi.get_field_name(self.ptr)
Example #5
0
from ctypes import byref, c_int