[geocode-glib] Add amenity place types to GeocodePlace



commit 9b0b84c6f0b2360d10f8ca5760aa6a0747dabc0c
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Wed Mar 26 22:23:39 2014 +0100

    Add amenity place types to GeocodePlace
    
    The place types selected here are among the top of the amenity
    category from http://taginfo.openstreetmap.org/keys/amenity#values
    
    https://bugzilla.gnome.org/show_bug.cgi?id=725899

 geocode-glib/geocode-forward.c |   10 ++++++++++
 geocode-glib/geocode-place.h   |   10 +++++++++-
 2 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/geocode-glib/geocode-forward.c b/geocode-glib/geocode-forward.c
index 0de5f50..6e01b2c 100644
--- a/geocode-glib/geocode-forward.c
+++ b/geocode-glib/geocode-forward.c
@@ -745,6 +745,16 @@ get_place_type_from_attributes (GHashTable *ht)
                         else if (rank == 4)
                                 place_type =  GEOCODE_PLACE_TYPE_COUNTRY;
                 }
+        } else if (g_strcmp0 (category, "amenity") == 0) {
+                if (g_strcmp0 (type, "school") == 0)
+                        place_type = GEOCODE_PLACE_TYPE_SCHOOL;
+                else if (g_strcmp0 (type, "place_of_worship") == 0)
+                        place_type = GEOCODE_PLACE_TYPE_PLACE_OF_WORSHIP;
+                else if (g_strcmp0 (type, "restaurant") == 0)
+                        place_type = GEOCODE_PLACE_TYPE_RESTAURANT;
+                else if (g_strcmp0 (type, "bar") == 0 ||
+                         g_strcmp0 (type, "pub") == 0)
+                        place_type = GEOCODE_PLACE_TYPE_BAR;
         }
 
         return place_type;
diff --git a/geocode-glib/geocode-place.h b/geocode-glib/geocode-place.h
index 9a06471..21d1fb1 100644
--- a/geocode-glib/geocode-place.h
+++ b/geocode-glib/geocode-place.h
@@ -97,6 +97,10 @@ struct _GeocodePlaceClass {
  * @GEOCODE_PLACE_TYPE_HISTORICAL_TOWN: A historical populated settlement that is no longer known by its 
original name.
  * @GEOCODE_PLACE_TYPE_OCEAN: One of the five major bodies of water on the Earth.
  * @GEOCODE_PLACE_TYPE_SEA: An area of open water smaller than an ocean.
+ * @GEOCODE_PLACE_TYPE_SCHOOL: Institution designed for learning under the supervision of teachers.
+ * @GEOCODE_PLACE_TYPE_PLACE_OF_WORSHIP: All places of worship independently of the religion or denomination.
+ * @GEOCODE_PLACE_TYPE_RESTAURANT: Generally formal place with sit-down facilities selling full meals served 
by waiters.
+ * @GEOCODE_PLACE_TYPE_BAR: A bar or pub.
  *
  * Type of the place.
  */
@@ -130,7 +134,11 @@ typedef enum {
         GEOCODE_PLACE_TYPE_ESTATE,
         GEOCODE_PLACE_TYPE_HISTORICAL_TOWN,
         GEOCODE_PLACE_TYPE_OCEAN,
-        GEOCODE_PLACE_TYPE_SEA
+        GEOCODE_PLACE_TYPE_SEA,
+        GEOCODE_PLACE_TYPE_SCHOOL,
+        GEOCODE_PLACE_TYPE_PLACE_OF_WORSHIP,
+        GEOCODE_PLACE_TYPE_RESTAURANT,
+        GEOCODE_PLACE_TYPE_BAR
 } GeocodePlaceType;
 
 #define GEOCODE_TYPE_PLACE (geocode_place_get_type ())


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]