MCPcopy Create free account
hub / github.com/CScorza/IntelOSINT / _to_decimal_degrees

Function _to_decimal_degrees

IntelOSINT.py:20455–20468  ·  view source on GitHub ↗
(value, reference)

Source from the content-addressed store, hash-verified

20453 return str(v)
20454
20455 def _to_decimal_degrees(value, reference):
20456 try:
20457 vals = value.values if hasattr(value, "values") else value
20458 if not isinstance(vals, (tuple, list)) or len(vals) != 3:
20459 return None
20460 d = float(vals[0].num) / float(vals[0].den)
20461 m = float(vals[1].num) / float(vals[1].den)
20462 s = float(vals[2].num) / float(vals[2].den)
20463 result = d + (m / 60.0) + (s / 3600.0)
20464 if str(reference).upper() in ["S", "W"]:
20465 result *= -1
20466 return result
20467 except Exception:
20468 return None
20469
20470 try:
20471 import exifread

Callers 1

probe_image_metadataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected