Conditions | 5 |
Total Lines | 15 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 5.0729 |
Changes | 0 |
1 | """utils.parse |
||
6 | 1 | def gps_parse(tags: dict): |
|
7 | """Returns GPS degrees""" |
||
8 | 1 | latitude = tags["GPS GPSLatitude"] |
|
9 | 1 | latitude_ref = tags["GPS GPSLatitudeRef"] |
|
10 | 1 | longitude = tags["GPS GPSLongitude"] |
|
11 | 1 | longitude_ref = tags["GPS GPSLongitudeRef"] |
|
12 | 1 | if latitude: |
|
13 | 1 | lat_value = _convert_to_degrees(latitude) |
|
14 | 1 | if latitude_ref.values != 'N': |
|
15 | lat_value = -lat_value |
||
16 | 1 | if longitude: |
|
17 | 1 | lon_value = _convert_to_degrees(longitude) |
|
18 | 1 | if longitude_ref.values != 'E': |
|
19 | lon_value = -lon_value |
||
20 | 1 | return {'latitude': lat_value, 'longitude': lon_value} |
|
21 | |||
34 |