watex.utils.geotools.smart_zoom#

watex.utils.geotools.smart_zoom(v)[source]#

select the ratio or value for zooming. Don’t raise any error, just return the original size. No shrunk need to be apply when error occurs.

Parameters:

v

str, float or iterable for zoom - str: 0.25% —> mean 25% view

1/4 —> means 25% view

  • iterable: [0, 120]–> the top starts a 0.m and bottom at 120.m

note: terable should contains only the top value and the bottom

value.

Returns:

ratio float value of iteration list value including the the value range (top and the bottom values).

Example:
>>> import watex.utils.geotools as GU
>>> GU.smart_zoom ('1/4')
... 0.25
>>> GU.smart_zoom ([60, 20])
... [20, 60]