libosmscout  0.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules
osmscout::LookupModule Class Reference

#include <LookupModule.h>

+ Inheritance diagram for osmscout::LookupModule:

Classes

class  ObjectInfo
 

Public Types

enum  AdminRegionLevel {
  NA1 = 1, Country = 2, Territory = 3, State = 4,
  NA5 = 5, Region = 6, District = 7, Town = 8,
  Neighbourhood = 9
}
 Common sense of administrative region levels. More...
 

Public Slots

void onDatabaseLoaded (QString dbPath, QList< osmscout::TileRef > tiles)
 
void onLoadJobFinished (QMap< QString, QMap< osmscout::TileKey, osmscout::TileRef >> tiles)
 
void requestLocationDescription (const osmscout::GeoCoord location)
 Start retrieving place information based on objects on or near the location. More...
 
void requestObjects (const LocationEntry &, bool reverseLookupAddresses)
 
void requestObjectsOnView (const MapViewStruct &, const QRectF &filterRectangle)
 
void requestRegionLookup (const osmscout::GeoCoord location)
 Start retrieving list of place admin regions. More...
 

Signals

void initialisationFinished (const osmscout::GeoBox &response)
 
void locationAdminRegionFinished (const osmscout::GeoCoord location)
 
void locationAdminRegions (const osmscout::GeoCoord location, QList< AdminRegionInfoRef > adminRegionList)
 
void locationDescription (const osmscout::GeoCoord location, const QString database, const osmscout::LocationDescription description, const QList< AdminRegionInfoRef > regions)
 
void locationDescriptionFinished (const osmscout::GeoCoord location)
 
void objectsLoaded (const LocationEntry &, const QList< LookupModule::ObjectInfo > &objects)
 
void viewObjectsLoaded (const MapViewStruct &, const QList< LookupModule::ObjectInfo > &objects)
 

Public Member Functions

 LookupModule (QThread *thread, DBThreadRef dbThread)
 
 ~LookupModule ()
 

Static Public Member Functions

static QStringList AdminRegionNames (const QList< AdminRegionInfoRef > &regionList, bool useAltNames)
 Helper method that returns list of unique admin region names. More...
 
static QStringList IndexedAdminRegionNames (const QList< AdminRegionInfoRef > &regionList, bool useAltNames)
 Helper method that returns names of admin region in indexed array. More...
 

Friends

class SearchLocationsRunnable
 
class SearchRunnable
 

Member Enumeration Documentation

◆ AdminRegionLevel

Common sense of administrative region levels.

Note that levels may have different meaning in various countries... https://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative

Enumerator
NA1 
Country 
Territory 
State 
NA5 
Region 
District 
Town 
Neighbourhood 

Constructor & Destructor Documentation

◆ LookupModule()

osmscout::LookupModule::LookupModule ( QThread *  thread,
DBThreadRef  dbThread 
)

◆ ~LookupModule()

osmscout::LookupModule::~LookupModule ( )

Member Function Documentation

◆ AdminRegionNames()

QStringList osmscout::LookupModule::AdminRegionNames ( const QList< AdminRegionInfoRef > &  regionList,
bool  useAltNames 
)
static

Helper method that returns list of unique admin region names.

When region list contains two (following) administrative regions with the same name (for example Prague "district", Prague "city"), it will return such name just once.

Parameters
regionList
Returns
list of admin region names

Referenced by osmscout::MapObjectInfoModel::data(), osmscout::NearPOIModel::data(), osmscout::LocationListModel::data(), and osmscout::LocationInfoModel::onLocationAdminRegions().

◆ IndexedAdminRegionNames()

QStringList osmscout::LookupModule::IndexedAdminRegionNames ( const QList< AdminRegionInfoRef > &  regionList,
bool  useAltNames 
)
static

Helper method that returns names of admin region in indexed array.

Array length is 12. When some level is not present, empty string is used. Level 2 are counties. Levels > 2 are country specific. See https://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative for meaning of individual levels.

Parameters
regionList
useAltNames
Returns
list of admin region names, indexed by admin region level

Referenced by osmscout::LocationListModel::data().

◆ initialisationFinished

void osmscout::LookupModule::initialisationFinished ( const osmscout::GeoBox response)
signal

◆ locationAdminRegionFinished

void osmscout::LookupModule::locationAdminRegionFinished ( const osmscout::GeoCoord  location)
signal

◆ locationAdminRegions

void osmscout::LookupModule::locationAdminRegions ( const osmscout::GeoCoord  location,
QList< AdminRegionInfoRef >  adminRegionList 
)
signal

◆ locationDescription

void osmscout::LookupModule::locationDescription ( const osmscout::GeoCoord  location,
const QString  database,
const osmscout::LocationDescription  description,
const QList< AdminRegionInfoRef >  regions 
)
signal

◆ locationDescriptionFinished

void osmscout::LookupModule::locationDescriptionFinished ( const osmscout::GeoCoord  location)
signal

◆ objectsLoaded

void osmscout::LookupModule::objectsLoaded ( const LocationEntry ,
const QList< LookupModule::ObjectInfo > &  objects 
)
signal

◆ onDatabaseLoaded

void osmscout::LookupModule::onDatabaseLoaded ( QString  dbPath,
QList< osmscout::TileRef tiles 
)
slot

Referenced by requestObjectsOnView().

◆ onLoadJobFinished

void osmscout::LookupModule::onLoadJobFinished ( QMap< QString, QMap< osmscout::TileKey, osmscout::TileRef >>  tiles)
slot

Referenced by requestObjectsOnView().

◆ requestLocationDescription

void osmscout::LookupModule::requestLocationDescription ( const osmscout::GeoCoord  location)
slot

Start retrieving place information based on objects on or near the location.

LookupModule then emits locationDescription signals followed by locationDescriptionFinished.

User of this function should use Qt::QueuedConnection for invoking this slot, operation may generate IO load and may tooks long time.

Parameters
location

References osmscout::LocationDescription::GetAtAddressDescription(), osmscout::LocationDescription::GetAtPOIDescription(), and osmscout::GeoBox::Includes().

Referenced by osmscout::LocationInfoModel::LocationInfoModel().

◆ requestObjects

void osmscout::LookupModule::requestObjects ( const LocationEntry entry,
bool  reverseLookupAddresses 
)
slot

◆ requestObjectsOnView

◆ requestRegionLookup

void osmscout::LookupModule::requestRegionLookup ( const osmscout::GeoCoord  location)
slot

Start retrieving list of place admin regions.

LookupModule then emits locationAdminRegions signals followed by locationAdminRegionFinished.

User of this function should use Qt::QueuedConnection for invoking this slot, operation may generate IO load and may tooks long time.

Parameters
location

References osmscout::GeoBox::Includes().

Referenced by osmscout::LocationInfoModel::LocationInfoModel(), and osmscout::LocationListModel::LocationListModel().

◆ viewObjectsLoaded

void osmscout::LookupModule::viewObjectsLoaded ( const MapViewStruct &  ,
const QList< LookupModule::ObjectInfo > &  objects 
)
signal

Friends And Related Function Documentation

◆ SearchLocationsRunnable

friend class SearchLocationsRunnable
friend

◆ SearchRunnable

friend class SearchRunnable
friend

The documentation for this class was generated from the following files: