1

I have a set of rasters which store solar radiation incidence over the course of a year. In QGIS, I want to map the same extent, and with the same reference features, varying only the solar raster within the set.

My idea was to create a master project file, symbolize and lay out the map in print composer using the first raster of the set, save the project, and then edit the .qgs file as XML. For each map in the series, I did a find and replace for all instances of the raster name, then saved as a new .qgs file.

When I opened the projects again in QGIS, each raster showed in the proper file, but it had lost its symbology and reverted to greyscale. Each file contains this code:

<customColorRamp>
  <colorRampType>INTERPOLATED</colorRampType>
  <colorRampEntry red="255" blue="236" value="0.000000" green="247" label=""/>
  <colorRampEntry red="254" blue="200" value="5000.000000" green="232" label=""/>
  <colorRampEntry red="253" blue="158" value="10000.000000" green="212" label=""/>
  <colorRampEntry red="253" blue="132" value="15000.000000" green="187" label=""/>
  <colorRampEntry red="252" blue="89" value="20000.000000" green="141" label=""/>
  <colorRampEntry red="239" blue="72" value="25000.000000" green="101" label=""/>
  <colorRampEntry red="215" blue="31" value="30000.000000" green="48" label=""/>
  <colorRampEntry red="153" blue="0" value="35000.000000" green="0" label=""/>
</customColorRamp>

Furthermore, a diff check on the files shows that resetting the symbology in QGIS and saving changes only the timestamp property within the file, nothing else.

So if the colormap isn't being saved in the .qgs, where is it being saved?

1 Answer 1

1

What's the idea behind creating separate project files? I'd recommend having all rasters in one project.

Style one of the rasters and save the style. Saving will create a .qml style file. Use the multiQML plugin to apply this style to all raster layers in the project.

1
  • I was hoping to save on memory use by doing each separately, since the project runs slowly with even one layer displayed over a shaded relief and a vector of water features.
    – dericke
    Commented May 25, 2012 at 15:16

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.