My Spatialite database has several thousand spatial polygon records In QGIS, each with a couple dozen field values. I also have many thousands more of additional tabular data relevant to those polygons, all stored within Spatialite, that the polygons need, a one to many relationship (a table as a value)

I'd like to create a QGIS ACTION of a single Field value that pops up a whole table stored within a single value in the spatial record. My initial strategy is to use a BLOB or Text to store HTML coded tables I create, so that the QGIS ACTION would open it up in a web browser. Opening up an equivalent table in Excel or some other common application would be satisfactory.

My worries are that I can't store html as a BLOB since its not binary. (but maybe that's not relevant). Also, I figure I can't store the html table as text since it would contain more characters of data than spatialite or shapefile can handle.

I can create an html coded page for each field value without a problem, but...

  1. How would I store the html page as a single field value in Spatialite or Shapefile?

  2. Or, what would be a good alternative to doing that, such as using another format besides html or BLOB data.

  3. Would it be possible to have a SQL query stored as a field value, and assign an Action that pops open the Results?

I'm understanding I could use PostGIS to create a database relationship if all else fails. It may be a day before I get back with any feedback. Thanks in advance for everyone's suggestions.

1 Answer 1


First part, you can store your HTML in a text field. SQLite doesn't have rigid field types like other database engines, so you can just define your field as text and move on. If you do decide to go with PostgreSQL, you can also define your field as text and store as much HTML in there as you need.

To display your HTML you can try using a map tip. Check out this blogpost on the feature. They define the HTML statically, but you might be able to choose your HTML field and have it work off that. Then again, it might not work, I've never tried it.


  • Storing HTML in the text field worked. Map Tips also worked; it displays the table just just fine. I haven't succeeded in getting an Action to pop open a wedbrowser. The Action TYPE is 'OPEN' followed by this command "C:/Program Files/Mozilla Firefox/firefox.exe[% "html_table" %]" html_table is the column name. Someone might be able to give me the proper command syntax. Thanks for the Map Tips!
    – user12711
    Commented Mar 21, 2013 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.