Some remote dive sites have no populated places (towns, cities) nearby. For such sites, we now fall back to looking up unpopulated place names, such as the reef or island name. Also some code refactorisation: the actual network access is now encapsulated in its own function removing some duplicated code handling in the reverseGeoLookup function and making it more readable. Furthermore, reverseGeoLookup() was completely refactored as most of its functionality was due to legacy requirements; the current code-base only calls this function from a single location and only with an empty taxonomy_data object. This makes the function more focussed and much simpler and more readable. Finally, a resource leak in reverseGeocde introduced in 4f3b26f9b6296273e37ec317bc68f32f94f546dc was fixed. Signed-off-by: Michael Werle <micha@michaelwerle.com>
13 lines
358 B
C
13 lines
358 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef DIVESITEHELPERS_H
|
|
#define DIVESITEHELPERS_H
|
|
|
|
#include "taxonomy.h"
|
|
#include "units.h"
|
|
|
|
/// Performs a reverse geo-lookup and returns the data.
|
|
/// It is up to the caller to merge the data with any existing data.
|
|
taxonomy_data reverseGeoLookup(degrees_t latitude, degrees_t longitude);
|
|
|
|
#endif // DIVESITEHELPERS_H
|