aboutsummaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2010-11-04 20:51:44 +0100
committerJochen Topf <jochen@topf.org>2010-11-04 20:51:44 +0100
commitc8b0e3ccd752f103f790aa790da50a3359c10453 (patch)
treeee3b6a6fedaaf54c2aeba2a5c7eb451f0785e0ee /sources
parent1292fe579b19061a0b5f69014b3635a1a2e9f9e1 (diff)
parente83097f2cfc6e3663adc009179c27bf9485c14f5 (diff)
downloadtaginfo-c8b0e3ccd752f103f790aa790da50a3359c10453.tar
taginfo-c8b0e3ccd752f103f790aa790da50a3359c10453.tar.gz
Merged potlatch branch
Diffstat (limited to 'sources')
-rwxr-xr-xsources/potlatch/import_potlatch.rb8
-rw-r--r--sources/potlatch/pre.sql20
2 files changed, 17 insertions, 11 deletions
diff --git a/sources/potlatch/import_potlatch.rb b/sources/potlatch/import_potlatch.rb
index b939cc6..61832e3 100755
--- a/sources/potlatch/import_potlatch.rb
+++ b/sources/potlatch/import_potlatch.rb
@@ -57,6 +57,10 @@ doc.elements.each('/mapFeatures/feature') do |feature_element|
on[$1.to_sym] = 1
when /^(category|help)$/
fields[element.name] = element.text.strip
+ when 'icon'
+ fields['icon_image'] = element.attributes['image']
+ fields['icon_background'] = element.attributes['background']
+ fields['icon_foreground'] = element.attributes['foreground']
end
end
@@ -64,8 +68,8 @@ doc.elements.each('/mapFeatures/feature') do |feature_element|
on = { :point => 1, :line => 1, :area => 1, :relation => 1 }
end
- db.execute('INSERT INTO features (name, category_id, help, on_point, on_line, on_area, on_relation) VALUES (?, ?, ?, ?, ?, ?, ?)',
- feature_name, fields['category'], fields['help'], on[:point], on[:line], on[:area], on[:relation])
+ db.execute('INSERT INTO features (name, category_id, help, on_point, on_line, on_area, on_relation, icon_image, icon_background, icon_foreground) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
+ feature_name, fields['category'], fields['help'], on[:point], on[:line], on[:area], on[:relation], fields['icon_image'], fields['icon_background'], fields['icon_foreground'])
end
db.execute('COMMIT');
diff --git a/sources/potlatch/pre.sql b/sources/potlatch/pre.sql
index 7f3a40b..9f79445 100644
--- a/sources/potlatch/pre.sql
+++ b/sources/potlatch/pre.sql
@@ -36,7 +36,6 @@ CREATE TABLE categories (
name TEXT
);
-
--
-- features
--
@@ -44,14 +43,17 @@ CREATE TABLE categories (
DROP TABLE IF EXISTS features;
CREATE TABLE features (
- name TEXT,
- category_id TEXT REFERENCES categories (id),
- category_name TEXT,
- help TEXT,
- on_point INTEGER,
- on_line INTEGER,
- on_area INTEGER,
- on_relation INTEGER
+ name TEXT,
+ category_id TEXT REFERENCES categories (id),
+ category_name TEXT,
+ help TEXT,
+ on_point INTEGER,
+ on_line INTEGER,
+ on_area INTEGER,
+ on_relation INTEGER,
+ icon_image TEXT,
+ icon_foreground TEXT,
+ icon_background TEXT
);
--