]> err.no Git - mapper/commitdiff
Handle some more amenities (speed trap, schools)
authorKaj-Michael Lang <milang@angel.tal.org>
Tue, 17 Jul 2007 12:35:53 +0000 (15:35 +0300)
committerKaj-Michael Lang <milang@angel.tal.org>
Tue, 17 Jul 2007 12:35:53 +0000 (15:35 +0300)
List appending is slow, prepend instead. Free the POI list after storing.

src/osm.c

index c0252e2962b10e0d3dde1edfa798f2a400acc88b..b6b5bf1b40fce66cbff9184ea605031b16ad9580 100644 (file)
--- a/src/osm.c
+++ b/src/osm.c
@@ -100,6 +100,7 @@ struct _nodeinfo {
        { "amenity", "restaurant",      NODE_AMENITY_FOOD },
        { "amenity", "parking",         NODE_AMENITY_PARKING },
        { "amenity", "hospital",        NODE_AMENITY_HOSPITAL },
+       { "amenity", "doctors", NODE_AMENITY_HOSPITAL },
        { "amenity", "pharmacy",        NODE_AMENITY_PHARMACY },
        { "amenity", "post_office",     NODE_AMENITY_POST },
        { "amenity", "post_box",        NODE_AMENITY_POST_BOX },
@@ -108,9 +109,13 @@ struct _nodeinfo {
        { "amenity", "atm",             NODE_AMENITY_ATM },
        { "amenity", "bank",            NODE_AMENITY_BANK },
        { "amenity", "police",          NODE_AMENITY_POLICE },
+       { "amenity", "speed_trap",              NODE_AMENITY_SPEEDCAM },
        { "amenity", "supermarket",     NODE_AMENITY_SHOP },
        { "amenity", "shop",            NODE_AMENITY_SHOP },
        { "amenity", "place_of_worship",NODE_AMENITY_POW },
+       { "amenity", "school",NODE_AMENITY_SCHOOL },
+       { "amenity", "college",NODE_AMENITY_COLLEGE },
+       { "amenity", "university",NODE_AMENITY_COLLEGE },
        { "railway", "station",         NODE_AMENITY_RAILWAY_STATION },
        { "railway", "halt",            NODE_AMENITY_RAILWAY_HALT },
        
@@ -668,6 +673,7 @@ g_print("Storing new POIs...\n");
 sqlite3_exec(db, "begin;", NULL, NULL, NULL);
 g_slist_foreach(osm_poi, osm_node_save_poi, NULL);
 sqlite3_exec(db, "commit;", NULL, NULL, NULL);
+g_slist_free(osm_poi);
 }
 
 /*********************************************************************/
@@ -855,7 +861,7 @@ switch (t) {
                if (cnode->data && cnode->data->type==NODE_PLAIN)
                        osm_free_node_data(cnode);
                else if (cnode->data) {
-                       osm_poi=g_slist_append(osm_poi, cnode);
+                       osm_poi=g_slist_prepend(osm_poi, cnode);
                }
                cnode=NULL;
        break;