marble
OsmDatabase.cpp
Go to the documentation of this file.
85 QSqlDatabase database = QSqlDatabase::addDatabase( "QSQLITE", QString( "marble/local-osm-search-%1" ).arg( reinterpret_cast<size_t>( this ) ) );
100 // Nested set model to support region hierarchies, see http://en.wikipedia.org/wiki/Nested_set_model
101 const QString regionsQueryString = "SELECT lft, rgt FROM regions WHERE name LIKE '%" + userQuery.region() + "%';";
104 qWarning() << regionsQuery.lastError() << "in" << databaseFile << "with query" << regionsQuery.lastQuery();
118 mDebug() << Q_FUNC_INFO << "region query in" << databaseFile << "with query" << regionsQueryString
183 GeoDataCoordinates coordinates( query.value(4).toFloat(), query.value(5).toFloat(), 0.0, GeoDataCoordinates::Degree );
202 mDebug() << "Offline OSM search query took" << timer.elapsed() << "ms for" << result.count() << "results.";
239 if ( MarbleGlobal::getInstance()->locale()->measurementSystem() == MarbleLocale::MetricSystem ) {
265 QString const fuzzyDistance = QString( "%1 %2" ).arg( distance, 0, 'f', precision ).arg( distanceUnit );
QVector< OsmPlacemark > find(const DatabaseQuery &userQuery)
Search the database for matching regions and placemarks.
Definition: OsmDatabase.cpp:79
iterator begin()
This file contains the headers for MarbleModel.
bool exec(const QString &query)
void setAdditionalInformation(const QString &name)
Definition: OsmPlacemark.cpp:68
A lightweight data structure to represent points of interest like addresses with support for serializ...
Definition: OsmPlacemark.h:24
void setCategory(OsmCategory category)
Definition: OsmPlacemark.cpp:28
QSqlDatabase addDatabase(const QString &type, const QString &connectionName)
ResultFormat resultFormat() const
Definition: DatabaseQuery.cpp:182
qreal distanceSphere(qreal lon1, qreal lat1, qreal lon2, qreal lat2)
This method calculates the shortest distance between two points on a sphere.
Definition: MarbleMath.h:52
qreal latitude(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
retrieves the latitude of the GeoDataCoordinates object use the unit parameter to switch between Radi...
Definition: GeoDataCoordinates.cpp:751
QString tr(const char *sourceText, const char *disambiguation, int n)
OsmPlacemark::OsmCategory category() const
Definition: DatabaseQuery.cpp:172
GeoDataCoordinates position() const
Definition: DatabaseQuery.cpp:207
int elapsed() const
int toInt(bool *ok) const
QVariant value(int index) const
QString lastQuery() const
bool isEmpty() const
bool isEmpty() const
void remove(int i)
bool next()
search which contains a poi category
Definition: DatabaseQuery.h:35
bool open()
void setForwardOnly(bool forward)
float toFloat(bool *ok) const
qreal longitude(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
retrieves the longitude of the GeoDataCoordinates object use the unit parameter to switch between Rad...
Definition: GeoDataCoordinates.cpp:739
bool contains(QChar ch, Qt::CaseSensitivity cs) const
QString & replace(int position, int n, QChar after)
int count(const T &value) const
QSqlError lastError() const
void setHouseNumber(const QString &houseNumber)
Definition: OsmPlacemark.cpp:48
OsmDatabase(const QStringList &databaseFiles)
Definition: OsmDatabase.cpp:74
void push_back(const T &value)
void start()
bool isValid() const
void setDatabaseName(const QString &name)
display results with location information
Definition: DatabaseQuery.h:40
int size() const
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
QString toString() const
iterator end()
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.