8

This is a silly question, but one I've been trying to figure out for a while. I have two Aster DEM tiles, one next to the other. How do I ensure uniform colour for both? how do I ensure uniform colour for adjacent DEM tiles?

  • 1
    use the same colour table – Vladimir Nov 26 '12 at 8:08
  • 1
    It should be noted that "having the same color table" and "having the same stretched color ramp" do not mean the same thing. – L_Holcombe Nov 26 '12 at 8:33
7

As Vladimir has suggested, you can do that by making sure they are using the same color table. You can do this by loading both DEMS in QGIS, then right clicking the DEM that has the color table you like and copying its style. You then select the other DEM, right click it and paste the style.

enter image description here

  • Thank you so much! Finally managed to sort it out this way. – Bernie Nov 26 '12 at 9:49
6

Hmmm, i would take a different approach. I would build a .vrt raster catalog (you can do so from QGIS raster menu) from all your DEMS, then assign a single pallete to that vrt file which acts as a single layer.

5

I see multiple answers here leading to a general styling to apply to all of your DEM's. The use of that answer is however directly related to the use you have in mind for them.

If you use them specifically for large areas with high differences in elevation, that might be the way to go. If you use DEMs as I do - to visualise relatively small differences for a very specific area, you're probably better of setting a minimum and maximum value by hand.

Worth noting might also be that using discrete steps rather then a continuous ramp, you'll visualise set elevation lines too.

Here's an example of what I usually end up doing: Example

I set discrete intervals every meter, gave them a color from high to low. 0 = black (cutouts for buildings) everything sub a minimum value I set to cyan, then gradually up. All above my max value is dark purple. I set it to a certain degree of transparency, overlay over a road map, and it gives me an indication of what area has a runoff of rainwater in what direction... (roughly water flows are perpendicular to the altitude lines), and the width of the color bands even gives an idea of how steep the terrain is.

You'll have guessed that every once in a while the area I need is on the border of two DEM's. If so, the color palet I set I save the .qml file for and load it on the next DEM I open.

Long story short: As for your coloring think ahead if you'll need large area with very large variations in heights to be displayed (if so go with a more generic solution to apply to ALL your DEMs), or want to make details or small differences pop up on a tiny level (like the image above). Your approach might be widely different.

2

there is a good blog from user @underdark here about SLD Support and other QGIS 1.8 Style Features. i think you should check out for your problem and more about styling.

SLD Support

Besides the classic QML layer style files, QGIS 1.8 supports the SLD standard. SLDs can be exported from and imported into new symbology.

enter image description here

One thing worth to note: SLDs can be exported from any type of renderer: single symbol, categorized, graduated or rule-based, but when importing an SLD, either a single symbol or rule-based renderer is created.

That means that categorized or graduated styles are converted to rule-based. If you want to preserve those renderers, you have to stick to the QML format. On the other hand, it could be very handy sometimes to have this easy way of converting styles to rule-based.

beside this if you want to write something about saving or anything you can use this code for saving your style....

aLayer = qgis.utils.iface.activeLayer()
aLayer.name() # Testing 
aLayer.saveSldStyle("myStyle.sld")

i hope it helps you...

1

If you do not have constrains in harddisk space, you can also try to merge the dems (raster/miscellaneous/merge). Then apply the color table you want to the merged raster.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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