Skip to content
Permalink
Browse files

symbol DB updated to support groups,tags for colorramp

  • Loading branch information
tecoholic committed Jul 26, 2012
1 parent 3943e8a commit ae031584c71bf4c91de25277f76ce2c084b87ff9
Showing with 8 additions and 3 deletions.
  1. BIN resources/symbology-ng-style.db
  2. +8 −3 scripts/symbol_xml2db.py
Binary file not shown.
@@ -37,7 +37,8 @@
_colorramp = "CREATE TABLE colorramp("\
"id INTEGER PRIMARY KEY,"\
"name TEXT,"\
"xml TEXT)"
"xml TEXT,"\
"groupid INTEGER)"

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

create_tables = [ _symbol, _colorramp, _tag, _tagmap, _symgroup, _smartgroup ]
_ctagmap = "CREATE TABLE ctagmap("\
"tag_id INTEGER NOT NULL,"\
"colorramp_id INTEGER)"

create_tables = [ _symbol, _colorramp, _tag, _tagmap, _ctagmap, _symgroup, _smartgroup ]

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

# Finally close the sqlite cursor

0 comments on commit ae03158

Please sign in to comment.
You can’t perform that action at this time.