5

I have SLD's/lyr files with my shp/gdb files. They all have the same name except for the extension. Is it possible for me to force qgis to load the sld with the shp so that I don't need to manually go to properties, load style and ok it?

In arcmap I can just open the lyr instead of the .shp -is there a similar process for qgis?

3
  • Where did those SLDs come from btw?
    – R.K.
    Commented Sep 21, 2012 at 6:56
  • These questions are only loosely related - they concern SLDs - but they really can and should be answered separately. I'll remove the second one. Please post it again.
    – underdark
    Commented Sep 21, 2012 at 7:21
  • +1 for auto-reading SLDs to be considered as an enhancement for QGIS - why not submit a feature request? It could possibly also be easily done as a python plugin.
    – Spacedman
    Commented Sep 21, 2012 at 9:19

2 Answers 2

2

I'm assuming we're both talking about the SLD XML schema specified by the Open Geospatial Consortium (OGC) for describing the appearance of map layers.

I have SLD's/lyr files with my shp/gdb files. They all have the same name except for the extension. Is it possible for me to force qgis to load the sld with the shp so that I don't need to manually go to properties, load style and ok it? In arcmap I can just open the lyr instead of the .shp -is there a similar process for qgis.

Unfortunately, you still have to load SLD styles manually for version 1.8 of QGIS.

2
  • Hi, Thanks RK. Yes QGIS is the only desktop GIS that seems to read SLD's. I wish the biggies did as well (promote c.na9.visual.force.com/apex/ideaView?id=08730000000870cAAA). My question was can qgis autoload the sld with the shp. It's quite a time consuming manual process associating SLD's with datasets in qgis/geoserver -it would be nice to be able to automate this process like when you open .lyr in arc. The base SLD's were created from the free ver of Arc2Earth -see gis.stackexchange.com/questions/27807/…
    – GeorgeC
    Commented Sep 22, 2012 at 12:18
  • 1
    uDig can import SLD styles too if I'm not mistaken. There currently seems to be no way of loading SLD styles automatically on the current version of QGIS ( 1.8 )
    – R.K.
    Commented Sep 22, 2012 at 13:32
2

While you cannot load .sld's automatically for a layer, if you want to have a shapefile styled automatically when loaded it can be done using .qml files.

enter image description here

If you save a QGIS style file with the same name as the shapefile, the style will automatically be applied when the file is loaded (aroads.shp and aroads.qml for example). Any changes that you make to symbology and save in a project will override the qml file when opening the project, but if just adding in the shapefile the qml styling will be applied.

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.