Пример #1
0
    def allowed_values(self):
        dt = self.data_type
        min_ = parse_raw_value(self.raw_value_min, dt)
        max_ = parse_raw_value(self.raw_value_max, dt)
        limits = gdal.GDT_NUMERIC_LIMITS[dt]

        return (
            min_ if min_ is not None else limits[0],
            max_ if max_ is not None else limits[1],
        )
Пример #2
0
    def allowed_values(self):
        dt = self.data_type
        min_ = parse_raw_value(self.raw_value_min, dt)
        max_ = parse_raw_value(self.raw_value_max, dt)
        limits = gdal.GDT_NUMERIC_LIMITS[dt]

        return (
            min_ if min_ is not None else limits[0],
            max_ if max_ is not None else limits[1],
        )
Пример #3
0
    def clean(self):
        nil_value_set = self.nil_value_set
        if nil_value_set and nil_value_set.data_type != self.data_type:
            raise ValidationError(
                "The data type of the band is not equal to the data type of "
                "its nil value set.")

        min_ = parse_raw_value(self.raw_value_min, self.data_type)
        max_ = parse_raw_value(self.raw_value_min, self.data_type)

        if min_ is not None and max_ is not None and min_ > max_:
            raise ValidationError("Minimum value larger than maximum value")
Пример #4
0
    def clean(self):
        nil_value_set = self.nil_value_set
        if nil_value_set and nil_value_set.data_type != self.data_type:
            raise ValidationError(
                "The data type of the band is not equal to the data type of "
                "its nil value set."
            )

        min_ = parse_raw_value(self.raw_value_min, self.data_type)
        max_ = parse_raw_value(self.raw_value_min, self.data_type)

        if min_ is not None and max_ is not None and min_ > max_:
            raise ValidationError("Minimum value larger than maximum value")
Пример #5
0
 def value(self):
     """ Get the parsed python value from the saved value string.
     """
     return parse_raw_value(self.raw_value, self.nil_value_set.data_type)
Пример #6
0
 def value(self):
     """ Get the parsed python value from the saved value string.
     """
     return parse_raw_value(self.raw_value, self.nil_value_set.data_type)