QGIS API Documentation
4.3.0-Master (9dce731a7a1)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
geocoding
qgsgooglemapsgeocoder.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsgooglemapsgeocoder.h
3
---------------
4
Date : November 2020
5
Copyright : (C) 2020 by Nyall Dawson
6
Email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSGOOGLEMAPSGEOCODER_H
17
#define QGSGOOGLEMAPSGEOCODER_H
18
19
#include "qgis_core.h"
20
#include "
qgsgeocoder.h
"
21
22
#include <QMutex>
23
40
class
CORE_EXPORT
QgsGoogleMapsGeocoder
:
public
QgsGeocoderInterface
41
{
42
public
:
53
QgsGoogleMapsGeocoder
(
const
QString &
apiKey
,
const
QString ®ionBias = QString() );
54
55
Flags
flags
()
const override
;
56
QgsFields
appendedFields
()
const override
;
57
Qgis::WkbType
wkbType
()
const override
;
58
QList< QgsGeocoderResult >
geocodeString
(
const
QString &
string
,
const
QgsGeocoderContext
&context,
QgsFeedback
*feedback =
nullptr
)
const override
;
59
63
QUrl
requestUrl
(
const
QString &address,
const
QgsRectangle
&bounds =
QgsRectangle
() )
const
;
64
68
QgsGeocoderResult
jsonToResult
(
const
QVariantMap &json )
const
;
69
73
void
setEndpoint
(
const
QString &endpoint );
74
80
QString
apiKey
()
const
;
81
89
void
setApiKey
(
const
QString &key );
90
96
QString
region
()
const
;
97
106
void
setRegion
(
const
QString &
region
);
107
108
private
:
109
QString mApiKey;
110
QString mRegion;
111
QString mEndpoint;
112
113
static
QReadWriteLock sMutex;
114
};
115
116
#endif
// QGSGOOGLEMAPSGEOCODER_H
Qgis::WkbType
WkbType
The WKB type describes the number of dimensions a geometry has.
Definition
qgis.h:314
QgsFeedback
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition
qgsfeedback.h:44
QgsFields
Container of fields for a vector layer.
Definition
qgsfields.h:45
QgsGeocoderContext
Encapsulates the context of a geocoding operation.
Definition
qgsgeocodercontext.h:31
QgsGeocoderInterface
Interface for geocoders.
Definition
qgsgeocoder.h:37
QgsGeocoderInterface::flags
virtual Flags flags() const =0
Returns the geocoder's capability flags.
QgsGeocoderInterface::wkbType
virtual Qgis::WkbType wkbType() const
Returns the WKB type of geometries returned by the geocoder.
Definition
qgsgeocoder.cpp:30
QgsGeocoderInterface::geocodeString
virtual QList< QgsGeocoderResult > geocodeString(const QString &string, const QgsGeocoderContext &context, QgsFeedback *feedback=nullptr) const
Geocodes a string.
Definition
qgsgeocoder.cpp:35
QgsGeocoderInterface::appendedFields
virtual QgsFields appendedFields() const
Returns a set of newly created fields which will be appended to existing features during the geocode ...
Definition
qgsgeocoder.cpp:25
QgsGeocoderInterface::Flags
QFlags< Flag > Flags
Definition
qgsgeocoder.h:45
QgsGeocoderResult
Represents a matching result from a geocoder search.
Definition
qgsgeocoderresult.h:41
QgsGoogleMapsGeocoder::setEndpoint
void setEndpoint(const QString &endpoint)
Sets a specific API endpoint to use for requests.
Definition
qgsgooglemapsgeocoder.cpp:274
QgsGoogleMapsGeocoder::jsonToResult
QgsGeocoderResult jsonToResult(const QVariantMap &json) const
Converts a JSON result returned from the Google Maps service to a geocoder result object.
Definition
qgsgooglemapsgeocoder.cpp:225
QgsGoogleMapsGeocoder::apiKey
QString apiKey() const
Returns the API key which will be used when accessing the Google Maps API.
Definition
qgsgooglemapsgeocoder.cpp:279
QgsGoogleMapsGeocoder::region
QString region() const
Returns the optional region bias which will be used to prioritize results in a certain region.
Definition
qgsgooglemapsgeocoder.cpp:289
QgsGoogleMapsGeocoder::requestUrl
QUrl requestUrl(const QString &address, const QgsRectangle &bounds=QgsRectangle()) const
Returns the URL generated for geocoding the specified address.
Definition
qgsgooglemapsgeocoder.cpp:164
QgsGoogleMapsGeocoder::QgsGoogleMapsGeocoder
QgsGoogleMapsGeocoder(const QString &apiKey, const QString ®ionBias=QString())
Constructor for QgsGoogleMapsGeocoder.
Definition
qgsgooglemapsgeocoder.cpp:42
QgsGoogleMapsGeocoder::setRegion
void setRegion(const QString ®ion)
Sets the optional region bias which will be used to prioritize results in a certain region.
Definition
qgsgooglemapsgeocoder.cpp:294
QgsGoogleMapsGeocoder::setApiKey
void setApiKey(const QString &key)
Sets the API key to use when accessing the Google Maps API.
Definition
qgsgooglemapsgeocoder.cpp:284
QgsRectangle
A rectangle specified with double values.
Definition
qgsrectangle.h:47
qgsgeocoder.h
Generated on
for QGIS API Documentation by
1.17.0