2
Copyright (C) 2012 Bastien Nocera
4
The Gnome Library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public License as
6
published by the Free Software Foundation; either version 2 of the
7
License, or (at your option) any later version.
9
The Gnome Library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public
15
License along with the Gnome Library; see the file COPYING.LIB. If not,
16
write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
Boston, MA 02110-1301 USA.
19
Authors: Bastien Nocera <hadess@hadess.net>
20
Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
25
#include <geocode-glib/geocode-place.h>
26
#include <geocode-glib/geocode-bounding-box.h>
27
#include <geocode-glib/geocode-enum-types.h>
28
#include <geocode-glib/geocode-glib-private.h>
31
* SECTION:geocode-place
32
* @short_description: Geocode place object
33
* @include: geocode-glib/geocode-glib.h
35
* The #GeocodePlace instance represents a place on earth. While
36
* #GeocodeLocation represents a point on the planet, #GeocodePlace represents
37
* places, e.g street, town, village, county, country or points of interest
41
struct _GeocodePlacePrivate {
43
GeocodePlaceType place_type;
44
GeocodeLocation *location;
45
GeocodeBoundingBox *bbox;
60
GeocodePlaceOsmType osm_type;
77
PROP_ADMINISTRATIVE_AREA,
87
G_DEFINE_TYPE (GeocodePlace, geocode_place, G_TYPE_OBJECT)
90
geocode_place_get_property (GObject *object,
95
GeocodePlace *place = GEOCODE_PLACE (object);
97
switch (property_id) {
99
g_value_set_string (value,
100
geocode_place_get_name (place));
103
case PROP_PLACE_TYPE:
104
g_value_set_enum (value,
105
geocode_place_get_place_type (place));
109
g_value_set_object (value,
110
geocode_place_get_location (place));
113
case PROP_STREET_ADDRESS:
114
g_value_set_string (value,
115
geocode_place_get_street_address (place));
119
g_value_set_string (value,
120
geocode_place_get_street (place));
124
g_value_set_string (value,
125
geocode_place_get_building (place));
128
case PROP_POSTAL_CODE:
129
g_value_set_string (value,
130
geocode_place_get_postal_code (place));
134
g_value_set_string (value,
135
geocode_place_get_area (place));
139
g_value_set_string (value,
140
geocode_place_get_town (place));
144
g_value_set_string (value,
145
geocode_place_get_county (place));
149
g_value_set_string (value,
150
geocode_place_get_state (place));
153
case PROP_ADMINISTRATIVE_AREA:
154
g_value_set_string (value,
155
geocode_place_get_administrative_area (place));
158
case PROP_COUNTRY_CODE:
159
g_value_set_string (value,
160
geocode_place_get_country_code (place));
164
g_value_set_string (value,
165
geocode_place_get_country (place));
169
g_value_set_string (value,
170
geocode_place_get_continent (place));
174
g_value_set_object (value,
175
geocode_place_get_icon (place));
179
g_value_set_object (value,
180
geocode_place_get_bounding_box (place));
184
g_value_set_string (value,
185
geocode_place_get_osm_id (place));
189
g_value_set_enum (value,
190
geocode_place_get_osm_type (place));
194
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
200
geocode_place_set_property(GObject *object,
205
GeocodePlace *place = GEOCODE_PLACE (object);
207
switch (property_id) {
209
place->priv->name = g_value_dup_string (value);
212
case PROP_PLACE_TYPE:
213
place->priv->place_type = g_value_get_enum (value);
217
place->priv->location = g_value_dup_object (value);
220
case PROP_STREET_ADDRESS:
221
geocode_place_set_street_address (place,
222
g_value_get_string (value));
226
geocode_place_set_street (place, g_value_get_string (value));
230
geocode_place_set_building (place, g_value_get_string (value));
233
case PROP_POSTAL_CODE:
234
geocode_place_set_postal_code (place,
235
g_value_get_string (value));
239
geocode_place_set_area (place, g_value_get_string (value));
243
geocode_place_set_town (place, g_value_get_string (value));
247
geocode_place_set_county (place, g_value_get_string (value));
251
geocode_place_set_state (place, g_value_get_string (value));
254
case PROP_ADMINISTRATIVE_AREA:
255
geocode_place_set_administrative_area (place,
256
g_value_get_string (value));
259
case PROP_COUNTRY_CODE:
260
geocode_place_set_country_code (place,
261
g_value_get_string (value));
265
geocode_place_set_country (place,
266
g_value_get_string (value));
270
geocode_place_set_continent (place, g_value_get_string (value));
274
place->priv->bbox = g_value_dup_object (value);
278
place->priv->osm_id = g_value_dup_string (value);
282
place->priv->osm_type = g_value_get_enum (value);
286
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
292
geocode_place_dispose (GObject *gplace)
294
GeocodePlace *place = (GeocodePlace *) gplace;
296
g_clear_object (&place->priv->location);
297
g_clear_object (&place->priv->bbox);
299
g_clear_pointer (&place->priv->name, g_free);
300
g_clear_pointer (&place->priv->osm_id, g_free);
301
g_clear_pointer (&place->priv->street_address, g_free);
302
g_clear_pointer (&place->priv->street, g_free);
303
g_clear_pointer (&place->priv->building, g_free);
304
g_clear_pointer (&place->priv->postal_code, g_free);
305
g_clear_pointer (&place->priv->area, g_free);
306
g_clear_pointer (&place->priv->town, g_free);
307
g_clear_pointer (&place->priv->county, g_free);
308
g_clear_pointer (&place->priv->state, g_free);
309
g_clear_pointer (&place->priv->admin_area, g_free);
310
g_clear_pointer (&place->priv->country_code, g_free);
311
g_clear_pointer (&place->priv->country, g_free);
312
g_clear_pointer (&place->priv->continent, g_free);
314
G_OBJECT_CLASS (geocode_place_parent_class)->dispose (gplace);
318
geocode_place_class_init (GeocodePlaceClass *klass)
320
GObjectClass *gplace_class = G_OBJECT_CLASS (klass);
323
gplace_class->dispose = geocode_place_dispose;
324
gplace_class->get_property = geocode_place_get_property;
325
gplace_class->set_property = geocode_place_set_property;
327
g_type_class_add_private (klass, sizeof (GeocodePlacePrivate));
332
* The name of the place.
334
pspec = g_param_spec_string ("name",
339
G_PARAM_STATIC_STRINGS);
340
g_object_class_install_property (gplace_class, PROP_NAME, pspec);
343
* GeocodePlace:place-type:
345
* The type of the place.
347
pspec = g_param_spec_enum ("place-type",
350
GEOCODE_TYPE_PLACE_TYPE,
351
GEOCODE_PLACE_TYPE_UNKNOWN,
353
G_PARAM_CONSTRUCT_ONLY |
354
G_PARAM_STATIC_STRINGS);
355
g_object_class_install_property (gplace_class, PROP_PLACE_TYPE, pspec);
358
* GeocodePlace:location:
360
* The location info for the place.
362
pspec = g_param_spec_object ("location",
365
GEOCODE_TYPE_LOCATION,
367
G_PARAM_STATIC_STRINGS);
368
g_object_class_install_property (gplace_class, PROP_LOCATION, pspec);
371
* GeocodePlace:street-address:
373
* The street address.
375
pspec = g_param_spec_string ("street-address",
380
G_PARAM_STATIC_STRINGS);
381
g_object_class_install_property (gplace_class, PROP_STREET_ADDRESS, pspec);
384
* GeocodePlace:street:
388
pspec = g_param_spec_string ("street",
393
G_PARAM_STATIC_STRINGS);
394
g_object_class_install_property (gplace_class, PROP_STREET, pspec);
397
* GeocodePlace:building:
399
* A specific building on a street or in an area.
401
pspec = g_param_spec_string ("building",
403
"A specific building on a street or in an area",
406
G_PARAM_STATIC_STRINGS);
407
g_object_class_install_property (gplace_class, PROP_BUILDING, pspec);
410
* GeocodePlace:postal-code:
414
pspec = g_param_spec_string ("postal-code",
419
G_PARAM_STATIC_STRINGS);
420
g_object_class_install_property (gplace_class, PROP_POSTAL_CODE, pspec);
425
* A named area such as a campus or neighborhood.
427
pspec = g_param_spec_string ("area",
429
"A named area such as a campus or neighborhood",
432
G_PARAM_STATIC_STRINGS);
433
g_object_class_install_property (gplace_class, PROP_AREA, pspec);
440
pspec = g_param_spec_string ("town",
445
G_PARAM_STATIC_STRINGS);
446
g_object_class_install_property (gplace_class, PROP_TOWN, pspec);
449
* GeocodePlace:state:
453
pspec = g_param_spec_string ("state",
458
G_PARAM_STATIC_STRINGS);
459
g_object_class_install_property (gplace_class, PROP_STATE, pspec);
462
* GeocodePlace:county:
466
pspec = g_param_spec_string ("county",
471
G_PARAM_STATIC_STRINGS);
472
g_object_class_install_property (gplace_class, PROP_COUNTY, pspec);
475
* GeocodePlace:administrative-area:
477
* The local administrative area.
479
pspec = g_param_spec_string ("administrative-area",
480
"AdministrativeArea",
481
"Local administrative area",
484
G_PARAM_STATIC_STRINGS);
485
g_object_class_install_property (gplace_class, PROP_ADMINISTRATIVE_AREA, pspec);
488
* GeocodePlace:country-code:
492
pspec = g_param_spec_string ("country-code",
497
G_PARAM_STATIC_STRINGS);
498
g_object_class_install_property (gplace_class, PROP_COUNTRY_CODE, pspec);
501
* GeocodePlace:country:
505
pspec = g_param_spec_string ("country",
510
G_PARAM_STATIC_STRINGS);
511
g_object_class_install_property (gplace_class, PROP_COUNTRY, pspec);
514
* GeocodePlace:continent:
518
pspec = g_param_spec_string ("continent",
523
G_PARAM_STATIC_STRINGS);
524
g_object_class_install_property (gplace_class, PROP_CONTINENT, pspec);
529
* #GIcon representing the @GeocodePlace.
531
pspec = g_param_spec_object ("icon",
533
"An icon representing the the place",
536
G_PARAM_STATIC_STRINGS);
537
g_object_class_install_property (gplace_class, PROP_ICON, pspec);
540
* GeocodePlace:bounding-box:
542
* The bounding box for the place.
544
pspec = g_param_spec_object ("bounding-box",
546
"The bounding box for the place",
547
GEOCODE_TYPE_BOUNDING_BOX,
549
G_PARAM_STATIC_STRINGS);
550
g_object_class_install_property (gplace_class, PROP_BBOX, pspec);
553
* GeocodePlace:osm-id:
555
* The OpenStreetMap id of the place.
557
pspec = g_param_spec_string ("osm-id",
559
"The OpenStreetMap ID of the place",
562
G_PARAM_STATIC_STRINGS);
563
g_object_class_install_property (gplace_class, PROP_OSM_ID, pspec);
566
* GeocodePlace:osm-type:
568
* The OpenStreetMap type of the place.
570
pspec = g_param_spec_enum ("osm-type",
572
"The OpenStreetMap type of the place",
573
GEOCODE_TYPE_PLACE_OSM_TYPE,
574
GEOCODE_PLACE_OSM_TYPE_UNKNOWN,
576
G_PARAM_STATIC_STRINGS);
577
g_object_class_install_property (gplace_class, PROP_OSM_TYPE, pspec);
581
geocode_place_init (GeocodePlace *place)
583
place->priv = G_TYPE_INSTANCE_GET_PRIVATE ((place),
585
GeocodePlacePrivate);
586
place->priv->bbox = NULL;
587
place->priv->osm_type = GEOCODE_PLACE_OSM_TYPE_UNKNOWN;
592
* @name: the name of place
593
* @place_type: the type of place
595
* Creates a new #GeocodePlace object.
597
* Returns: a new #GeocodePlace object. Use g_object_unref() when done.
600
geocode_place_new (const char *name,
601
GeocodePlaceType place_type)
603
return g_object_new (GEOCODE_TYPE_PLACE,
605
"place-type", place_type,
610
* geocode_place_new_with_location:
611
* @name: the name of place
612
* @place_type: the type of place
613
* @location: the location info for the place
615
* Creates a new #GeocodePlace object.
617
* Returns: a new #GeocodePlace object. Use g_object_unref() when done.
620
geocode_place_new_with_location (const char *name,
621
GeocodePlaceType place_type,
622
GeocodeLocation *location)
624
return g_object_new (GEOCODE_TYPE_PLACE,
626
"place-type", place_type,
627
"location", location,
632
* geocode_place_set_name:
634
* @name: the name of place
636
* Sets the name of the @place to @name.
639
geocode_place_set_name (GeocodePlace *place,
642
g_return_if_fail (GEOCODE_IS_PLACE (place));
643
g_return_if_fail (name != NULL);
645
g_free (place->priv->name);
646
place->priv->name = g_strdup (name);
650
* geocode_place_get_name:
653
* Gets the name of the @place.
655
* Returns: The name of the @place.
658
geocode_place_get_name (GeocodePlace *place)
660
g_return_val_if_fail (GEOCODE_IS_PLACE (place), NULL);
662
return place->priv->name;
667
* geocode_place_get_place_type:
670
* Gets the type of the @place.
672
* Returns: The type of the @place.
675
geocode_place_get_place_type (GeocodePlace *place)
677
g_return_val_if_fail (GEOCODE_IS_PLACE (place),
678
GEOCODE_PLACE_TYPE_UNKNOWN);
680
return place->priv->place_type;
684
* geocode_place_set_location:
686
* @location: A location
688
* Sets the location of @place to @location.
691
geocode_place_set_location (GeocodePlace *place,
692
GeocodeLocation *location)
694
g_return_if_fail (GEOCODE_IS_PLACE (place));
695
g_return_if_fail (GEOCODE_IS_LOCATION (location));
697
g_clear_object (&place->priv->location);
698
place->priv->location = g_object_ref (location);
702
* geocode_place_get_location:
705
* Gets the associated location object.
707
* Returns: (transfer none): The associated location object.
710
geocode_place_get_location (GeocodePlace *place)
712
g_return_val_if_fail (GEOCODE_IS_PLACE (place), NULL);
714
return place->priv->location;
718
* geocode_place_set_street_address:
720
* @street_address: a street address for the place
722
* Sets the street address of @place to @street_address.
725
geocode_place_set_street_address (GeocodePlace *place,
726
const char *street_address)
728
g_return_if_fail (GEOCODE_IS_PLACE (place));
729
g_return_if_fail (street_address != NULL);
731
g_free (place->priv->street_address);
732
place->priv->street_address = g_strdup (street_address);
736
* geocode_place_get_street_address:
739
* Gets the street address of the @place.
741
* Returns: The street address of the @place.
744
geocode_place_get_street_address (GeocodePlace *place)
746
g_return_val_if_fail (GEOCODE_IS_PLACE (place), NULL);
748
return place->priv->street_address;
752
* geocode_place_set_street:
756
* Sets the street of @place to @street.
759
geocode_place_set_street (GeocodePlace *place,
762
g_return_if_fail (GEOCODE_IS_PLACE (place));
763
g_return_if_fail (street != NULL);
765
g_free (place->priv->street);
766
place->priv->street = g_strdup (street);
770
* geocode_place_get_street:
773
* Gets the street of the @place.
775
* Returns: The street of the @place.
778
geocode_place_get_street (GeocodePlace *place)
780
g_return_val_if_fail (GEOCODE_IS_PLACE (place), NULL);
782
return place->priv->street;
786
* geocode_place_set_building:
788
* @building: a building
790
* Sets the building of @place to @building.
793
geocode_place_set_building (GeocodePlace *place,
794
const char *building)
796
g_return_if_fail (GEOCODE_IS_PLACE (place));
797
g_return_if_fail (building != NULL);
799
g_free (place->priv->building);
800
place->priv->building = g_strdup (building);
804
* geocode_place_get_building:
807
* Gets the building of the @place.
809
* Returns: The building of the @place.
812
geocode_place_get_building (GeocodePlace *place)
814
g_return_val_if_fail (GEOCODE_IS_PLACE (place), NULL);
816
return place->priv->building;
820
* geocode_place_set_postal_code:
822
* @postal_code: a postal code for the place
824
* Sets the postal code of @place to @postal_code.
827
geocode_place_set_postal_code (GeocodePlace *place,
828
const char *postal_code)
830
g_return_if_fail (GEOCODE_IS_PLACE (place));
831
g_return_if_fail (postal_code != NULL);
833
g_free (place->priv->postal_code);
834
place->priv->postal_code = g_strdup (postal_code);
838
* geocode_place_get_postal_code:
841
* Gets the postal code of the @place.
843
* Returns: The postal code of the @place.
846
geocode_place_get_postal_code (GeocodePlace *place)
848
g_return_val_if_fail (GEOCODE_IS_PLACE (place), NULL);
850
return place->priv->postal_code;
854
* geocode_place_set_area:
858
* Sets the area of @place to @area.
861
geocode_place_set_area (GeocodePlace *place,
864
g_return_if_fail (GEOCODE_IS_PLACE (place));
865
g_return_if_fail (area != NULL);
867
g_free (place->priv->area);
868
place->priv->area = g_strdup (area);
872
* geocode_place_get_area:
875
* Gets the area of the @place.
877
* Returns: The area of the @place.
880
geocode_place_get_area (GeocodePlace *place)
882
g_return_val_if_fail (GEOCODE_IS_PLACE (place), NULL);
884
return place->priv->area;
888
* geocode_place_set_town:
890
* @town: a town for the place
892
* Sets the town of @place to @town.
895
geocode_place_set_town (GeocodePlace *place,
898
g_return_if_fail (GEOCODE_IS_PLACE (place));
899
g_return_if_fail (town != NULL);
901
g_free (place->priv->town);
902
place->priv->town = g_strdup (town);
906
* geocode_place_get_town:
909
* Gets the town of the @place.
911
* Returns: The town of the @place.
914
geocode_place_get_town (GeocodePlace *place)
916
g_return_val_if_fail (GEOCODE_IS_PLACE (place), NULL);
918
return place->priv->town;
922
* geocode_place_set_county:
924
* @county: a county for the place
926
* Sets the county of @place to @county.
929
geocode_place_set_county (GeocodePlace *place,
932
g_return_if_fail (GEOCODE_IS_PLACE (place));
933
g_return_if_fail (county != NULL);
935
g_free (place->priv->county);
936
place->priv->county = g_strdup (county);
940
* geocode_place_get_county:
943
* Gets the county of the @place.
945
* Returns: The country of the @place.
948
geocode_place_get_county (GeocodePlace *place)
950
g_return_val_if_fail (GEOCODE_IS_PLACE (place), NULL);
952
return place->priv->county;
956
* geocode_place_set_state:
958
* @state: a state for the place
960
* Sets the state of @place to @state.
963
geocode_place_set_state (GeocodePlace *place,
966
g_return_if_fail (GEOCODE_IS_PLACE (place));
967
g_return_if_fail (state != NULL);
969
g_free (place->priv->state);
970
place->priv->state = g_strdup (state);
974
* geocode_place_get_state:
977
* Gets the state of the @place.
979
* Returns: The state of the @place.
982
geocode_place_get_state (GeocodePlace *place)
984
g_return_val_if_fail (GEOCODE_IS_PLACE (place), NULL);
986
return place->priv->state;
990
* geocode_place_set_administrative_area:
992
* @admin_area: an administrative area for the place
994
* Sets the local administrative area of @place to @admin_area.
997
geocode_place_set_administrative_area (GeocodePlace *place,
998
const char *admin_area)
1000
g_return_if_fail (GEOCODE_IS_PLACE (place));
1001
g_return_if_fail (admin_area != NULL);
1003
g_free (place->priv->admin_area);
1004
place->priv->admin_area = g_strdup (admin_area);
1008
* geocode_place_get_administrative_area:
1011
* Gets the local administrative area of the @place.
1013
* Returns: The local administrative area of the @place.
1016
geocode_place_get_administrative_area (GeocodePlace *place)
1018
g_return_val_if_fail (GEOCODE_IS_PLACE (place), NULL);
1020
return place->priv->admin_area;
1024
* geocode_place_set_country_code:
1026
* @country_code: an ISO country code for the place
1028
* Sets the ISO country code of @place to @country_code.
1031
geocode_place_set_country_code (GeocodePlace *place,
1032
const char *country_code)
1034
g_return_if_fail (GEOCODE_IS_PLACE (place));
1035
g_return_if_fail (country_code != NULL);
1037
g_free (place->priv->country_code);
1038
place->priv->country_code = g_utf8_strup (country_code, -1);
1042
* geocode_place_get_country_code:
1045
* Gets the ISO-3166 country code of the @place.
1047
* Returns: The ISO-3166 country code of the @place, in upper case.
1050
geocode_place_get_country_code (GeocodePlace *place)
1052
g_return_val_if_fail (GEOCODE_IS_PLACE (place), NULL);
1054
return place->priv->country_code;
1058
* geocode_place_set_country:
1060
* @country: a country for the place
1062
* Sets the country of @place to @country.
1065
geocode_place_set_country (GeocodePlace *place,
1066
const char *country)
1068
g_return_if_fail (GEOCODE_IS_PLACE (place));
1069
g_return_if_fail (country != NULL);
1071
g_free (place->priv->country);
1072
place->priv->country = g_strdup (country);
1076
* geocode_place_get_country:
1079
* Gets the country of the @place.
1081
* Returns: The country of the @place.
1084
geocode_place_get_country (GeocodePlace *place)
1086
g_return_val_if_fail (GEOCODE_IS_PLACE (place), NULL);
1088
return place->priv->country;
1092
* geocode_place_set_continent:
1094
* @continent: a continent for the place
1096
* Sets the continent of @place to @continent.
1099
geocode_place_set_continent (GeocodePlace *place,
1100
const char *continent)
1102
g_return_if_fail (GEOCODE_IS_PLACE (place));
1103
g_return_if_fail (continent != NULL);
1105
g_free (place->priv->continent);
1106
place->priv->continent = g_strdup (continent);
1110
* geocode_place_get_continent:
1113
* Gets the continent of the @place.
1115
* Returns: The continent of the @place.
1118
geocode_place_get_continent (GeocodePlace *place)
1120
g_return_val_if_fail (GEOCODE_IS_PLACE (place), NULL);
1122
return place->priv->continent;
1126
get_icon_name (GeocodePlace *place)
1130
switch (place->priv->place_type) {
1132
case GEOCODE_PLACE_TYPE_BUILDING:
1133
icon_name = "poi-building";
1136
case GEOCODE_PLACE_TYPE_TOWN:
1137
icon_name = "poi-town";
1140
case GEOCODE_PLACE_TYPE_AIRPORT:
1141
icon_name = "poi-airport";
1144
case GEOCODE_PLACE_TYPE_RAILWAY_STATION:
1145
icon_name = "poi-railway-station";
1148
case GEOCODE_PLACE_TYPE_BUS_STOP:
1149
icon_name = "poi-bus-stop";
1152
case GEOCODE_PLACE_TYPE_STREET:
1153
icon_name = "poi-car";
1156
case GEOCODE_PLACE_TYPE_SCHOOL:
1157
icon_name = "poi-school";
1160
case GEOCODE_PLACE_TYPE_PLACE_OF_WORSHIP:
1161
icon_name = "poi-place-of-worship";
1164
case GEOCODE_PLACE_TYPE_RESTAURANT:
1165
icon_name = "poi-restaurant";
1168
case GEOCODE_PLACE_TYPE_BAR:
1169
icon_name = "poi-bar";
1172
case GEOCODE_PLACE_TYPE_LIGHT_RAIL_STATION:
1173
icon_name = "poi-light-rail-station";
1177
icon_name = "poi-marker"; /* generic marker */
1185
* geocode_place_get_icon:
1188
* Gets the #GIcon representing the @place.
1190
* Returns: (transfer none): The #GIcon representing the @place.
1193
geocode_place_get_icon (GeocodePlace *place)
1197
g_return_val_if_fail (GEOCODE_IS_PLACE (place), NULL);
1199
icon_name = get_icon_name (place);
1201
return g_icon_new_for_string (icon_name, NULL);
1205
* geocode_place_get_bounding_box:
1208
* Gets the bounding box for the place @place.
1210
* Returns: (transfer none): A #GeocodeBoundingBox, or NULL if boundaries are
1213
GeocodeBoundingBox *
1214
geocode_place_get_bounding_box (GeocodePlace *place)
1216
g_return_val_if_fail (GEOCODE_IS_PLACE (place), NULL);
1218
return place->priv->bbox;
1222
* geocode_place_set_bounding_box:
1224
* @bbox: A #GeocodeBoundingBox for the place
1226
* Sets the #GeocodeBoundingBox for the place @place.
1230
geocode_place_set_bounding_box (GeocodePlace *place,
1231
GeocodeBoundingBox *bbox)
1233
g_return_if_fail (GEOCODE_IS_PLACE (place));
1234
g_return_if_fail (GEOCODE_IS_BOUNDING_BOX (bbox));
1236
g_clear_object (&place->priv->bbox);
1237
place->priv->bbox = g_object_ref (bbox);
1241
* geocode_place_get_osm_id:
1244
* Gets the OpenStreetMap ID of the @place.
1246
* Returns: The osm ID of the @place.
1249
geocode_place_get_osm_id (GeocodePlace *place)
1251
g_return_val_if_fail (GEOCODE_IS_PLACE (place), NULL);
1253
return place->priv->osm_id;
1257
* geocode_place_get_osm_type:
1260
* Gets the OpenStreetMap type of the @place.
1262
* Returns: The osm type of the @place.
1265
geocode_place_get_osm_type (GeocodePlace *place)
1267
g_return_val_if_fail (GEOCODE_IS_PLACE (place), GEOCODE_PLACE_OSM_TYPE_UNKNOWN);
1269
return place->priv->osm_type;