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.Forward
structure are private and should never be accessed directly.- classmethod new_for_params(params)¶
- Parameters:
params ({
str
:GObject.Value
}) – aGLib.HashTable
with string keys, andGObject.Value
values.- Returns:
a new
GeocodeGlib.Forward
. UseGObject.Object.unref
() when done.- Return type:
Creates a new
GeocodeGlib.Forward
to perform geocoding with. TheGLib.HashTable
is 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.Forward
to perform forward geocoding with. The string is in free-form format.
- get_bounded()¶
- Return type:
Gets the
GeocodeGlib.Forward
:bounded
property that regulates whether theGeocodeGlib.Forward
:search-area
property acts restricting or not.
- get_search_area()¶
- Returns:
the search area, or
None
if none is set- Return type:
Gets the area to limit searches within.
- search()¶
- Raises:
- Returns:
A list of places or
None
in 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.Backend
for more information.If no results are found, a
GeocodeGlib.Error.NO_MATCHES
error is returned.
- search_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
forward,None
to ignore.callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – 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
None
in 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.Backend
orNone
) – aGeocodeGlib.Backend
, orNone
to 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
) –True
to restrict results to only items contained within theGeocodeGlib.Forward
:search-area
bounding box.
Set the
GeocodeGlib.Forward
:bounded
property that regulates whether theGeocodeGlib.Forward
:search-area
property 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
True
then only results in theGeocodeGlib.Forward
:search-area
bounding box are returned. If set toFalse
theGeocodeGlib.Forward
:search-area
is 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
:bounded
property is set toTrue
only results from this area is returned.