Skip to content

Commit ae03158

Browse files
author
Arunmozhi
committedJul 26, 2012
symbol DB updated to support groups,tags for colorramp
1 parent 3943e8a commit ae03158

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed
 

‎resources/symbology-ng-style.db

1 KB
Binary file not shown.

‎scripts/symbol_xml2db.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
_colorramp = "CREATE TABLE colorramp("\
3838
"id INTEGER PRIMARY KEY,"\
3939
"name TEXT,"\
40-
"xml TEXT)"
40+
"xml TEXT,"\
41+
"groupid INTEGER)"
4142

4243
_tag = "CREATE TABLE tag("\
4344
"id INTEGER PRIMARY KEY,"\
@@ -57,7 +58,11 @@
5758
"name TEXT,"\
5859
"xml TEXT)"
5960

60-
create_tables = [ _symbol, _colorramp, _tag, _tagmap, _symgroup, _smartgroup ]
61+
_ctagmap = "CREATE TABLE ctagmap("\
62+
"tag_id INTEGER NOT NULL,"\
63+
"colorramp_id INTEGER)"
64+
65+
create_tables = [ _symbol, _colorramp, _tag, _tagmap, _ctagmap, _symgroup, _smartgroup ]
6166

6267
# Create the DB with required Schema
6368
conn = sqlite3.connect( dbfile )
@@ -93,7 +98,7 @@
9398
colorramps = dom.getElementsByTagName( "colorramp" )
9499
for ramp in colorramps:
95100
ramp_name = ramp.getAttribute( "name" )
96-
c.execute( "INSERT INTO colorramp VALUES (?,?,?)", ( None, ramp_name, ramp.toxml() ) )
101+
c.execute( "INSERT INTO colorramp VALUES (?,?,?,?)", ( None, ramp_name, ramp.toxml(), None ) )
97102
conn.commit()
98103

99104
# Finally close the sqlite cursor

0 commit comments

Comments
 (0)
Please sign in to comment.