ooiservices/app/uframe/assetController.py
def _get_latlon(item):
    """
    given raw string for lat or lon, scrub and calculate float result;
    finally truncate to _decimal_places; default is 7 decimal places.
    returns: lat or lon as decimal degrees (float) or None
    """
    _decimal_places = 4
    result = None
    degrees = 0.0
    minutes = 0.0
    seconds = 0.0
    # scrub input
    tmp = _normalize(item)
    # process input and round result to _decimal places
    if isinstance(item, unicode) and len(tmp.split()) > 1:
        digits = re.findall("\S.*[0-9.]+", tmp)
        direction = re.findall("[NSEW]", tmp)
        tmp = "%s %s" % (digits[0], direction[0])
        ds = tmp.split(' ')
        degrees = float(ds[0])
        minutes = float(ds[1])
        if len(ds) == 4:
            seconds = float(ds[2])
        val = degrees + ((minutes + (seconds/60.00000))/60.00000)
        # round to _decimal_places
        tmp = str(round(val, _decimal_places))
        result = float(tmp)
        if math.isnan(result):
            return 0.0
        return result
    else:
        if item == "":
            return 0.0
        return float(item)

    given raw string for lat or lon, scrub and calculate float result;
    finally truncate to _decimal_places; default is 7 decimal places.
    returns: lat or lon as decimal degrees (float) or None
    
given raw string for lat or lon, scrub and calculate float result;
finally truncate to _decimal_places; default is 7 decimal places.
returns: lat or lon as decimal degrees (float) or None
given raw string for lat or lon scrub and calculate float result ; finally truncate to _decimal_places ; default is 7 decimal places . returns : lat or lon as decimal degrees ( float ) or None
def _get_latlon(item):
    _decimal_places = 4
    result = None
    degrees = 0.0
    minutes = 0.0
    seconds = 0.0
    tmp = _normalize(item)
    if isinstance(item, unicode) and len(tmp.split()) > 1:
        digits = re.findall("\S.*[0-9.]+", tmp)
        direction = re.findall("[NSEW]", tmp)
        tmp = "%s %s" % (digits[0], direction[0])
        ds = tmp.split(' ')
        degrees = float(ds[0])
        minutes = float(ds[1])
        if len(ds) == 4:
            seconds = float(ds[2])
        val = degrees + ((minutes + (seconds/60.00000))/60.00000)
        tmp = str(round(val, _decimal_places))
        result = float(tmp)
        if math.isnan(result):
            return 0.0
        return result
    else:
        if item == "":
            return 0.0
        return float(item)
def _get_latlon ( item ) : _decimal_places = 4 result = None degrees = 0.0 minutes = 0.0 seconds = 0.0 tmp = _normalize ( item ) if isinstance ( item , unicode ) and len ( tmp . split ( ) ) > 1 : digits = re . findall ( "\S.*[0-9.]+" , tmp ) direction = re . findall ( "[NSEW]" , tmp ) tmp = "%s %s" % ( digits [ 0 ] , direction [ 0 ] ) ds = tmp . split ( ' ' ) degrees = float ( ds [ 0 ] ) minutes = float ( ds [ 1 ] ) if len ( ds ) == 4 : seconds = float ( ds [ 2 ] ) val = degrees + ( ( minutes + ( seconds / 60.00000 ) ) / 60.00000 ) tmp = str ( round ( val , _decimal_places ) ) result = float ( tmp ) if math . isnan ( result ) : return 0.0 return result else : if item == "" : return 0.0 return float ( item )
given raw string for lat or lon, scrub and calculate float result;
finally truncate to _decimal_places; default is 7 decimal places.
given raw string for lat or lon scrub and calculate float result ; finally truncate to _decimal_places ; default is 7 decimal places .
"""
    given raw string for lat or lon, scrub and calculate float result;
    finally truncate to _decimal_places; default is 7 decimal places.
    returns: lat or lon as decimal degrees (float) or None
    """ # scrub input # process input and round result to _decimal places # round to _decimal_places
item