I have a number of vectors (points, lines and polygons) loaded into PostGIS (not QGIS Server). I would like to provide a colour schema based on attribute values which is saved as a default. What I am hoping to be able to do is have my layers symbolized (ie: blue for lakes, black for roads and a star for capital cities) so that when users from other computers connect to the PostGIS database the layers are loaded with the symbology.

Is there a way to save all the symbols within PostGIS similar to a style file?


2 Answers 2


Not that I know of plus it would be impracticable. Best bet is to use QGIS. Style them and save that style. Take the time to name it so you can recall it 2 months later. The style files can build up quickly. Check out this recent article about symbolizing in QGIS. http://underdark.wordpress.com/2012/08/15/introducing-the-latest-style-user-interface-improvements/

Definitely bookmark her(underdark) blog. Lots of up to date goodies

For server side, I use GeoServer with PostGIS. You can style the layer via XML with a number desktop apps. Beware though, some are better than others and none of them do everything you want. Not for the faint of heart, it can be very frustrating.

Hope this helps

  • Thank you, that is what I have been doing, but I wasn't sure if there was a better way. Aug 16, 2012 at 23:17

Many years ago (2000-2003?) I wrote an ArcView 3.x extension called CustomThemes that essentially tried to model this same capability. I wrote all of the "add data" knowledge (TOC Name in plain english, data path/filename, layer description, default layer colors, layer style path/filename, metadata path/filename, and more) into a database table. Then with a custom Add Data button/GUI, the layers would be symbolized on the fly when it was added to the map document based upon preferences set in the database table.

If you download the extension from ArcScripts, it has a sample database (dbf) and a surprisingly well-documented CHM help (I had forgot that I created it!) that shows the database design and the UI that I created for the custom "Add Data" process. Look in the "Developers Guide" section of the help for more specifics on how I did it.

Obviously a lot of things have gotten better since 2000, but the concept remains the same! Here is a user forum summary from way back (although the webpage is long gone).

You could probably do something very similar with QGIS without too much work.

Your Answer

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

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