GeocodeNominatim

GeocodeNominatim — Geocoding resolver using a Nominatim web service

Synopsis

#include <geocode-glib/geocode-glib.h>

#define             GEOCODE_TYPE_NOMINATIM
struct              GeocodeNominatimClass;
GeocodeNominatim *  geocode_nominatim_new               (const gchar *base_url,
                                                         const gchar *maintainer_email_address);
GeocodeNominatim *  geocode_nominatim_get_gnome         (void);

Description

Contains functions for geocoding using the [OSM Nominatim APIs](http://wiki.openstreetmap.org/wiki/Nominatim) exposed by a Nominatim server at a given URI. By default, the GNOME Nominatim server is used, but other server details may be given when constructing a GeocodeNominatim.

Details

GEOCODE_TYPE_NOMINATIM

#define GEOCODE_TYPE_NOMINATIM (geocode_nominatim_get_type ())

See GeocodeNominatim.

Since 3.23.1


struct GeocodeNominatimClass

struct GeocodeNominatimClass {
	GObjectClass parent_class;

	gchar *(*query)        (GeocodeNominatim    *self,
	                        const gchar         *uri,
	                        GCancellable        *cancellable,
	                        GError             **error);

	void   (*query_async)  (GeocodeNominatim    *self,
	                        const gchar         *uri,
	                        GCancellable        *cancellable,
	                        GAsyncReadyCallback  callback,
	                        gpointer             user_data);

	gchar *(*query_finish) (GeocodeNominatim    *self,
	                        GAsyncResult        *res,
	                        GError             **error);
};

GeocodeNominatim allows derived classes to override its query functions, which are called for each network request the Nominatim client makes. All network requests are `GET`s with no request body; just a URI. The default implementation makes the requests internally, but derived classes may want to override these queries to check the URIs for testing, for example.

Applications should not normally have to derive GeocodeNominatim; these virtual methods are mainly intended for testing.

GObjectClass parent_class;

query ()

synchronous query function to override network `GET` requests.

query_async ()

asynchronous version of query.

query_finish ()

asynchronous finish function for query_async.

Since 3.23.1


geocode_nominatim_new ()

GeocodeNominatim *  geocode_nominatim_new               (const gchar *base_url,
                                                         const gchar *maintainer_email_address);

Creates a new backend implementation for an online Nominatim server. See the documentation for "base-url" and "maintainer-email-address".

base_url :

a the base URL of the Nominatim server.

maintainer_email_address :

the email address of the software maintainer.

Returns :

a new GeocodeNominatim. Use g_object_unref() when done. [transfer full]

Since 3.23.1


geocode_nominatim_get_gnome ()

GeocodeNominatim *  geocode_nominatim_get_gnome         (void);

Gets a reference to the default Nominatim server on nominatim.gnome.org.

This function is thread-safe.

Returns :

a new GeocodeNominatim. Use g_object_unref() when done. [transfer full]

Since 3.23.1