@@ -287,7 +287,8 @@ static std::string v2s(const std::vector<std::string> &v)
287
287
return s;
288
288
}
289
289
290
- bool GeoMaster::search (const QString &searchPattern, QJsonObject &result, size_t limit,
290
+ bool GeoMaster::search (const QString &searchPattern, QJsonObject &result,
291
+ const GeoNLP::Geocoder::GeoReference &reference, size_t limit,
291
292
double &lat, double &lon, std::string &name, size_t &number_of_results)
292
293
{
293
294
QMutexLocker lk (&m_mutex);
@@ -378,7 +379,7 @@ bool GeoMaster::search(const QString &searchPattern, QJsonObject &result, size_t
378
379
// search
379
380
m_geocoder.set_max_results (limit);
380
381
std::vector<GeoNLP::Geocoder::GeoResult> search_result_country;
381
- if ( !m_geocoder.search (parsed_query, search_result_country, levels_resolved) )
382
+ if ( !m_geocoder.search (parsed_query, search_result_country, levels_resolved, reference ) )
382
383
{
383
384
InfoHub::logError (tr (" Error while searching with geocoder-nlp" ));
384
385
return false ;
@@ -412,6 +413,7 @@ bool GeoMaster::search(const QString &searchPattern, QJsonObject &result, size_t
412
413
result.insert (" query" , searchPattern);
413
414
result.insert (" parsed" , parsed);
414
415
result.insert (" parsed_normalized" , parsed_normalized);
416
+ result.insert (" reference_used" , reference.is_set () ? 1 : 0 );
415
417
416
418
{
417
419
QJsonArray arr;
@@ -452,8 +454,9 @@ bool GeoMaster::search(const QString &searchPattern, double &lat, double &lon, s
452
454
{
453
455
QJsonObject obj;
454
456
size_t number_of_results;
457
+ GeoNLP::Geocoder::GeoReference reference;
455
458
456
- if ( !search (searchPattern, obj, 1 , lat, lon, name, number_of_results ) )
459
+ if ( !search (searchPattern, obj, reference, 1 , lat, lon, name, number_of_results ) )
457
460
{
458
461
InfoHub::logWarning (" Search for reference point failed" );
459
462
return false ;
@@ -466,14 +469,14 @@ bool GeoMaster::search(const QString &searchPattern, double &lat, double &lon, s
466
469
return false ;
467
470
}
468
471
469
- bool GeoMaster::searchExposed (const QString &searchPattern, QByteArray &result, size_t limit, bool full_result)
472
+ bool GeoMaster::searchExposed (const QString &searchPattern, QByteArray &result, GeoNLP::Geocoder::GeoReference reference, size_t limit, bool full_result)
470
473
{
471
474
QJsonObject sres;
472
475
double lat, lon;
473
476
std::string name;
474
477
size_t number_of_results;
475
478
476
- if ( !search (searchPattern, sres, limit, lat, lon, name, number_of_results ) )
479
+ if ( !search (searchPattern, sres, reference, limit, lat, lon, name, number_of_results ) )
477
480
return false ;
478
481
479
482
if (!full_result)
0 commit comments