]> err.no Git - mapper/commitdiff
Add missing poi categories. Misc sql statements changes.
authorKaj-Michael Lang <milang@angel.tal.org>
Wed, 8 Aug 2007 08:43:26 +0000 (11:43 +0300)
committerKaj-Michael Lang <milang@angel.tal.org>
Wed, 8 Aug 2007 08:43:26 +0000 (11:43 +0300)
src/poi.c

index 325c867bc6d18c75affb55b2a6b1d213742602f2..edf384d33d0ad2e7fe58d25210d374b46f72fa80 100644 (file)
--- a/src/poi.c
+++ b/src/poi.c
 #include "osm.h"
 
 struct sql_poi_stmt {
-       sqlite3_stmt *_stmt_select_poi;
-       sqlite3_stmt *_stmt_select_nearest_poi;
-       sqlite3_stmt *_stmt_insert_poi;
-       sqlite3_stmt *_stmt_update_poi;
-       sqlite3_stmt *_stmt_delete_poi;
-       sqlite3_stmt *_stmt_delete_poi_by_catid;
-       sqlite3_stmt *_stmt_nextlabel_poi;
-       sqlite3_stmt *_stmt_select_cat;
-       sqlite3_stmt *_stmt_insert_cat;
-       sqlite3_stmt *_stmt_update_cat;
-       sqlite3_stmt *_stmt_delete_cat;
-       sqlite3_stmt *_stmt_toggle_cat;
-       sqlite3_stmt *_stmt_selall_cat;
+       sqlite3_stmt *select_poi;
+       sqlite3_stmt *select_nearest_poi;
+       sqlite3_stmt *insert_poi;
+       sqlite3_stmt *update_poi;
+       sqlite3_stmt *delete_poi;
+       sqlite3_stmt *delete_poi_by_catid;
+       sqlite3_stmt *nextlabel_poi;
+       sqlite3_stmt *select_cat;
+       sqlite3_stmt *insert_cat;
+       sqlite3_stmt *update_cat;
+       sqlite3_stmt *delete_cat;
+       sqlite3_stmt *toggle_cat;
+       sqlite3_stmt *selall_cat;
+       sqlite3_stmt *select_quick_cat;
 };
 static struct sql_poi_stmt poisql;
 
@@ -69,6 +70,7 @@ struct _poi_categories {
 static struct _poi_categories default_poi_categories[] = {
        {NODE_AMENITY_PARKING, "Parking", "Parking place for vehicles." },
        {NODE_AMENITY_FUEL, "Fuel", "Stations for purchasing fuel for vehicles." },
+       {NODE_AMENITY_FUEL, "Speed Cam", "Automatic speed cameras." },
        {NODE_AMENITY_HOSPITAL, "Hospital", "" },
        {NODE_AMENITY_PHARMACY, "Pharmacy", "Place to get drugs." },
        {NODE_AMENITY_POLICE, "Police", "Police station"},
@@ -79,12 +81,16 @@ static struct _poi_categories default_poi_categories[] = {
        {NODE_AMENITY_BANK, "Bank", "Place to take care of your money."},
        {NODE_AMENITY_POST, "Post office", "Place to handle mail."},
        {NODE_AMENITY_POST_BOX, "Post box", "Send letters."},
+       {NODE_AMENITY_TOURISM_INFO, "Tourism info", "A place for tourists to get information."},
        {NODE_AMENITY_TAXI, "Taxi station", "Get a Taxi here."},
        {NODE_AMENITY_RAILWAY_STATION, "Railway station", "Transportation by train."},
        {NODE_AMENITY_RAILWAY_HALT, "Railway halt", ""},
        {NODE_AMENITY_BUS_STATION, "Bus station", "Transportation by bus."},
        {NODE_AMENITY_BOAT, "Harbour", "Transportation by boat."},
        {NODE_AMENITY_AIRPORT, "Airport", "Transportation by air."},
+       {NODE_AMENITY_CAMP_SITE, "Camp site", "Place to go camping"},
+       {NODE_AMENITY_CARAVAN_SITE, "Caravan site", ""},
+       {NODE_AMENITY_PICNIC_SITE, "Picnic", "Place to have a Picnic"},
        {NODE_AMENITY_FOOD, "Restaurant, Fast food", "Places to eat or drink."},
        {NODE_AMENITY_PUB, "Pub, Disco, Club", "Place to drink and party."},
        {NODE_AMENITY_CAFE, "Cafe", "Place to drink coffe or tee and eat."},
@@ -248,6 +254,12 @@ poi_db_prepare(sqlite3 *db)
                        " group by c.cat_id, c.label, c.desc, c.enabled "
                        " order by c.priority,c.label", -1, &_stmt_selall_cat, NULL);
 
+       /* Select quick categories */
+       sqlite3_prepare_v2(db,
+                       "select c.cat_id, c.label, c.icon, c.color"
+                       " from category c where c.enabled=1 "
+                       " order by c.priority,c.label limit 9", -1, &poisql.select_quick_cat, NULL);
+
        return TRUE;
 }