GeocodeGlib.Forward¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
The number of requested results |
||
r/w |
Bind search results to search-area |
||
r/w |
The area to limit search within |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent_instance |
r |
Class Details¶
- class GeocodeGlib.Forward(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
All the fields in the
GeocodeGlib.Forwardstructure are private and should never be accessed directly.- classmethod new_for_params(params)¶
- Parameters:
params ({
str:GObject.Value}) – aGLib.HashTablewith string keys, andGObject.Valuevalues.- Returns:
a new
GeocodeGlib.Forward. UseGObject.Object.unref() when done.- Return type:
Creates a new
GeocodeGlib.Forwardto perform geocoding with. TheGLib.HashTableis in the format used by Telepathy, and documented on Telepathy’s specification site.See also: XEP-0080 specification.
- classmethod new_for_string(str)¶
- Parameters:
str (
str) – a string containing a free-form description of the location- Returns:
a new
GeocodeGlib.Forward. UseGObject.Object.unref() when done.- Return type:
Creates a new
GeocodeGlib.Forwardto perform forward geocoding with. The string is in free-form format.
- get_bounded()¶
- Return type:
Gets the
GeocodeGlib.Forward:boundedproperty that regulates whether theGeocodeGlib.Forward:search-areaproperty acts restricting or not.
- get_search_area()¶
- Returns:
the search area, or
Noneif none is set- Return type:
Gets the area to limit searches within.
- search()¶
- Raises:
- Returns:
A list of places or
Nonein case of errors. Free the returned instances withGObject.Object.unref() and the list with g_list_free() when done.- Return type:
Gets the result of a forward geocoding query using the current backend (see
GeocodeGlib.Forward.set_backend()). By default the GNOME Nominatim server is used. SeeGeocodeGlib.Backendfor more information.If no results are found, a
GeocodeGlib.Error.NO_MATCHESerror is returned.
- search_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableforward,Noneto ignore.callback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfieduser_data (
objectorNone) – the data to pass to callback function
Asynchronously performs a forward geocoding query using a web service. Use
GeocodeGlib.Forward.search() to do the same thing synchronously.When the operation is finished, callback will be called. You can then call
GeocodeGlib.Forward.search_finish() to get the result of the operation.
- search_finish(res)¶
- Parameters:
res (
Gio.AsyncResult) – aGio.AsyncResult.- Raises:
- Returns:
A list of places or
Nonein case of errors. Free the returned instances withGObject.Object.unref() and the list with g_list_free() when done.- Return type:
Finishes a forward geocoding operation. See
GeocodeGlib.Forward.search_async().
- set_answer_count(count)¶
- Parameters:
count (
int) – the number of requested results, which must be greater than zero
Sets the number of requested results to count.
- set_backend(backend)¶
- Parameters:
backend (
GeocodeGlib.BackendorNone) – aGeocodeGlib.Backend, orNoneto use the default one.
Specifies the backend to use in the forward geocoding operation.
If none is given, the default GNOME Nominatim server is used.
New in version 3.23.1.
- set_bounded(bounded)¶
- Parameters:
bounded (
bool) –Trueto restrict results to only items contained within theGeocodeGlib.Forward:search-areabounding box.
Set the
GeocodeGlib.Forward:boundedproperty that regulates whether theGeocodeGlib.Forward:search-areaproperty acts restricting or not.
- set_search_area(box)¶
- Parameters:
box (
GeocodeGlib.BoundingBox) – a bounding box to limit the search area.
Sets the area to limit searches within.
Property Details¶
- GeocodeGlib.Forward.props.answer_count¶
-
The number of requested results to a search query.
- GeocodeGlib.Forward.props.bounded¶
-
If set to
Truethen only results in theGeocodeGlib.Forward:search-areabounding box are returned. If set toFalsetheGeocodeGlib.Forward:search-areais treated like a preferred area for results.
- GeocodeGlib.Forward.props.search_area¶
- Name:
search-area- Type:
- Default Value:
- Flags:
The bounding box that limits the search area. If
GeocodeGlib.Forward:boundedproperty is set toTrueonly results from this area is returned.