Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

Thanks....

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

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.

share|improve this answer
add comment

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

share|improve this answer
    
Thank you, that is what I have been doing, but I wasn't sure if there was a better way. –  Ryan Garnett Aug 16 '12 at 23:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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