Library of styles that can be used by impact functions
E.g.:
from impact_functions.styles import flood_population_style as style_info
from impact_functions.core import get_function_title
# Create raster object with this style and return
R = Raster(
I,
projection=inundation.get_projection(),
geotransform=inundation.get_geotransform(),
name='Penduduk yang %s' % (get_function_title(self)),
keywords={'impact_summary': impact_summary},
style_info=style_info)
return R
Style with equidistant hue and optional data defined saturation :param target_field: field name that needs to be classified :type: target_field, str
Parameters: |
|
---|---|
Type: | categories, list |
Type: | no_data_value, int, str |
Type: | no_data_label, str |
Type: | data_defined_saturation_field, None, str |
Type: | max_impact_value, int, float |
Returns: | a dict with target_field, style_classes and style_type |
Return type: | dict |
Makes a color ramp with equal HUE intervals. Sat and value are constant :param class_count: amount of hue steps (class count) :type: class_count, int
Parameters: |
|
---|---|
Type: | reverse_hue, bool |
Type: | saturation, float |
Type: | value, float |
Returns: | a dict of list containing the HSV, RGB and HEX representation of the color ramp. some thing like this:
|
Return type: | dict |
Convert hue, saturation, value tuple to an hex sting. :param hsv: a (hue, saturation, value) tuple where hsv are 0-1 :type: hsv, tuple
Returns: | the hexadecimal color string. |
---|---|
Return type: | str |
Convert an rgb tuple in an hex sting. :param rgb: a (r, g, b) tuple where r, g, b are 0-255 :type: rgb, tuple
Returns: | the hexadecimal color string. |
---|---|
Return type: | str |
See: | http://stackoverflow.com/q/214359/#answer-214657 |