GeocodeGlib.Forward

g GObject.Object GObject.Object GeocodeGlib.Forward GeocodeGlib.Forward GObject.Object->GeocodeGlib.Forward

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new_for_params (params)

class

new_for_string (str)

get_answer_count ()

get_bounded ()

get_search_area ()

search ()

search_async (cancellable, callback, *user_data)

search_finish (res)

set_answer_count (count)

set_backend (backend)

set_bounded (bounded)

set_search_area (box)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

answer-count

int

r/w

The number of requested results

bounded

bool

r/w

Bind search results to search-area

search-area

GeocodeGlib.BoundingBox

r/w

The area to limit search within

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class GeocodeGlib.Forward(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GeocodeGlib.ForwardClass

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}) – a GLib.HashTable with string keys, and GObject.Value values.

Returns:

a new GeocodeGlib.Forward. Use GObject.Object.unref() when done.

Return type:

GeocodeGlib.Forward

Creates a new GeocodeGlib.Forward to perform geocoding with. The GLib.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. Use GObject.Object.unref() when done.

Return type:

GeocodeGlib.Forward

Creates a new GeocodeGlib.Forward to perform forward geocoding with. The string is in free-form format.

get_answer_count()
Return type:

int

Gets the number of requested results for searches.

get_bounded()
Return type:

bool

Gets the GeocodeGlib.Forward :bounded property that regulates whether the GeocodeGlib.Forward :search-area property acts restricting or not.

get_search_area()
Returns:

the search area, or None if none is set

Return type:

GeocodeGlib.BoundingBox or None

Gets the area to limit searches within.

search()
Raises:

GLib.Error

Returns:

A list of places or None in case of errors. Free the returned instances with GObject.Object.unref() and the list with g_list_free() when done.

Return type:

[GeocodeGlib.Place]

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. See GeocodeGlib.Backend for more information.

If no results are found, a GeocodeGlib.Error.NO_MATCHES error is returned.

search_async(cancellable, callback, *user_data)
Parameters:

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) – a Gio.AsyncResult.

Raises:

GLib.Error

Returns:

A list of places or None in case of errors. Free the returned instances with GObject.Object.unref() and the list with g_list_free() when done.

Return type:

[GeocodeGlib.Place]

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 or None) – a GeocodeGlib.Backend, or None 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 the GeocodeGlib.Forward :search-area bounding box.

Set the GeocodeGlib.Forward :bounded property that regulates whether the GeocodeGlib.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
Name:

answer-count

Type:

int

Default Value:

10

Flags:

READABLE, WRITABLE

The number of requested results to a search query.

GeocodeGlib.Forward.props.bounded
Name:

bounded

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

If set to True then only results in the GeocodeGlib.Forward :search-area bounding box are returned. If set to False the GeocodeGlib.Forward :search-area is treated like a preferred area for results.

GeocodeGlib.Forward.props.search_area
Name:

search-area

Type:

GeocodeGlib.BoundingBox

Default Value:

None

Flags:

READABLE, WRITABLE

The bounding box that limits the search area. If GeocodeGlib.Forward :bounded property is set to True only results from this area is returned.