Google-style relief shading - thoughts?
#1
Posted 13 January 2009 - 01:56 PM
The end result is interesting, but I'm not convinced its worth replicating in my own maps. Has anyone used this style of relief with any success? Does this style have a name, or is anyone else using it successfully besides Google?
#2
Posted 13 January 2009 - 03:45 PM
I'm not too sure what to call Google's shading - but it definitely uses multiple directions (not too sure if they use oblique weighting - to my eye it doesn't look like they do).
There are a variety of resources online to investigate further techniques.
Two that instantly jump to mind are T. Patterson's Shaded Relief and Relief Shading from the Institute of Cartography in Switzerland.
Oregon Metro - Portland, OR
www.oregonmetro.gov
#3
Posted 13 January 2009 - 05:30 PM
For comparison, I'm attaching two images of Switzerland showing relief (height) shading and slope shading. The Google terrain map of Switzerland is here.
Attached Files
#4
Posted 06 February 2009 - 07:42 PM
http://pubs.usgs.gov...22/of92-422.pdf
#5
Posted 07 February 2009 - 03:56 PM
As an aside, ESRI's World Relief layer is less detailed, but also includes some use of slope or azimuth light blending, I would guess (370, 60) with smoothing at low elevations:
Attached Files
#6
Posted 19 July 2009 - 12:35 AM
...The end result is interesting, but I'm not convinced its worth replicating in my own maps. Has anyone used this style of relief with any success? Does this style have a name, or is anyone else using it successfully besides Google?
I can't give you any info on the providence of the style, but can give some suggestions if you're wanting to give it a shot...
We created a hillshade that replicates it pretty well -- with much more detail. Ended up creating a bunch of raster layers in ArcMap, exported to TIFF and composited in Photoshop to allow WYSIWYG tweaking with dramatic ease. It also allowed us to remove detail from the areas that are most likely to have other content layered upon it using masks. Easy. Effective. The result is pretty good, too.
We did make one improvement, drawing from an approach used to simulate natural lighting in 3d rendering workflows. Shadows aren't black and sunlight isn't white, so we added a bit of purple shading to the shadows, and a bit of orange to the highlights--and when I say "a bit", I mean a very little bit. Just enough to give a hint of color. Makes a big difference, and helps the result not feel so "lunar" (shades of gray).
Sorry, no example to show at the moment. Soon. Wish I could be of more help. Good luck.
Eric Geddes, GIS Specialist
City of San Luis Obispo, California
#7
Posted 19 July 2009 - 06:27 PM
BTW, welcome to the Cartotalk forum. I saw some of your work down in San Diego last week at the ESRI UC and thought it was really nice. Congrats!
Oregon Metro - Portland, OR
www.oregonmetro.gov
#8
Posted 20 July 2009 - 10:26 AM
The end result is interesting, but I'm not convinced its worth replicating in my own maps. Has anyone used this style of relief with any success? Does this style have a name, or is anyone else using it successfully besides Google?
I do use a similar method for shaded-relief in my street maps. "Traditional" shaded-relief (lighting from the northwest) conveys the lay of the land well, but it leaves flat areas a neutral gray. In my opinion, this doesn't work well with detailed street maps, because most development tends to happen in flatter areas, so the gray terrain reduces the legibility of information which (in my maps) is more important than shaded-relief (such as roadlines and roadnames). However, I do think it's helpful to indicate slopes on street maps, so I experimented with lighting from directly overhead. This achieved the goal of showing slopes, but then it was difficult to "read" the terrain, and to get a mental "feel" for the lay of the land. So then I tried using Photoshop to blend the two methods (traditional and overhead), and came up with something I'm pleased with, similar to Google's style. It's a subtle shaded-relief layer that I think gives a good feel for the landscape without muddling the more important navigational info. Here are a few recent examples:
Estes Park CO
Grand Junction CO
Muscatine IA
Trinidad CO
professionally: cartographics manager for Dex One
personally: cartophile and road-geek (my website)
#9
Posted 09 August 2009 - 03:41 PM
This is the first time I've tried to upload attachments, so if they don't show up, it is due to my fumbling.
Google_Maps.png 567.29K
274 downloads
Sample_relief.png 117.37K
322 downloads
#10
Posted 10 August 2009 - 07:37 AM
Francois Goulet
---
www.fgcartographix.com :: blog.fgcartographix.com :: http://twitter.com/fgcartographix
#11
Posted 10 August 2009 - 10:45 AM
I was able to closely reproduce Google's relief with Manifold and PaintShop. (Those are the only tools I have, since I'm a rank amateur and can't justify the expense of proper tools). The shaded relief was produced in Manifold using a pure white palette, with lighting at 315° azimuth, 75° elevation. I mapped the surface colors to the relief in Paintshop Pro, using a series of arithmetic operations that implements a shading algorithm I've used ever since I began experimenting with maps. I have a feeling that my color-mapping formula may supply some of the effects that seem to be due to multiple lighting sources, but which in my case are just a subtle form of specular highlight.
This is the first time I've tried to upload attachments, so if they don't show up, it is due to my fumbling.Google_Maps.png 567.29K 274 downloads
Sample_relief.png 117.37K 322 downloads
What was your source data?
Which hillshade settings and Photoshop effects/adjustments were made?
#12
Posted 10 August 2009 - 01:31 PM
What was your source data?
Which hillshade settings and Photoshop effects/adjustments were made?
The process is going to sound convoluted, perhaps even silly, but keep in mind that I am an amateur whose priorities are to use inexpensive tools at the cost of extra labor. The tools were Manifold and Paintshop Pro. I can tell you the steps, and you can see if they translate to whatever tools you use.
The sample was a 1:200,000 scale Transverse Mercator, in the neighborhood of Williamsport, PA, USA.
The source data was the 1/3 arc-second National Elevation Dataset. I exaggerated the elevations by a factor of 4. In Manifold, I did that by applying Surface/ Effects/ Filter... and set the matrix so that the central pixel is multiplied by 4, all others are zero, and the scale is 1.
Next, I projected the surface elevation data to the map projection, and clipped it to the view I wanted. Doing the projection first seems to give better results with the shaded relief. Clipping just reduces the amount of data.
The shaded relief was created with Manifold's built-in shading. In order to use it for my color-mapping stages in Paintshop Pro, I need to coax Manifold to use a predictable algorithm, which I do by forcing it to use a white palette. In Manifold, this is accomplished with the View / Display Options dialog. I load a prepared single-color palette:
<?xml version="1.0" encoding="UTF-8"?> <theme> <type>color</type> <interval>true</interval> <colors> <color>#ffffff</color> </colors> <colorMin>#ffffff</colorMin> <colorMax>#ffffff</colorMax> <colorDef>#000000</colorDef> <values> <value>500</value> </values> </theme>
and then enable shading, setting the azimuth to 315° and the altitude to 75°. The prepared palette is essential, since without it, Manifold does an automatic contrast adjustment that leads to unpredictable results. Also, my color mapping technique in Paintshop Pro depends on knowing the color value of horizontal flat regions.
After creating the relief, I usually rescale the surface so that the dimensions match the dimensions of the image that I want to obtain. That helps smooth out the graininess of the surface when the elevation data is higher resolution than the image.
I then create a layout, using a custom page size that yields the image dimensions. Manifold seems to use 96 dpi on my system, so I compute the page size based on that resolution. I convert the layout to an image by using the Tools / Make image... dialog, then export the resulting image to the file system as a PNG. That gives me a grayscale image of the shaded relief.
To create the terrain colors, I hide the surface and just export the basic map background, which in this case was a RGB background color {209, 219, 194}, along with the hydrography from the National Hydrography Dataset. I used the flowlines, areas, and waterbodies from the dataset.
There are probably easier ways to drap the surface colors on the relief, but since my budget is low, I use Paintshop Pro and make use of its image arithmetic to compute the colors for a given grayscale value. There are two separate color calculations: one for colors shaded darker than the color of horizontally flat areas, and one for colors shaded lighter than the flat areas.
I'm sure that Manifold's shading algorithm is the simple one based on the angle of incidence to the surface (I forget the name of the algorithm, but it is well known and easy to implement). That means that horizontally flat pixels aren't pure white, but are slightly shaded because of the 75° angle of the light. The pixels that are exactly perpendicular (normal) to the light source will be pure white.
Because I want the result to exactly match my basic surface colors on horizontally flat regions, the color computation needs to take into account that in the relief image, the RGB value of horizontal regions are not {255,255,255}, but are in fact {246,246,246}.
Basically, the shading computations implement these two pixel color equations:
P1 = P0 * [ 1 - f *(G0 - G) /G0 ], or in other words, the shadow-color RGB channel P0 is scaled linearly based on the grayscale relief value G, from the original color, down to black; where f is a scaling factor that prevents the color from going all the way to black. Any pixels that are brighter than G0, the grayscale value of horizontal pixels, are unchanged.
P2 = (255 - P0) * f * (G - G0), or in other words, highlights are scaled linearly from the original color to white, based on the grayscale relief value; where f is a scaling factor that tones down the highlights. Any pixels darker than G0 are unchanged. Bright highlights give a glossy look to the relief, as if it were an image of a plastic relief map.
The result is simply the sum P1 + P2.
Mechanically, I accomplish this in Paintshop Pro with a series of image arithmetic operations:
1. Import the grayscale relief image (#1).
2. Import the color map image (#2).
3. Create a uniform grayscale gray image using G0 = horizontal gray value, giving image #3. Typical G0 = 246. The value will depend on the elevation angle of the light when the shaded relief was created.
4. Subtract #1 (relief) from #3 (gray) giving #4.
5. Subtract #3 (gray) from #1 relief giving #5.
6. Multiply #2 color map by #4 with divisor = G0 (246) , giving #6.
7. Multiply #6 by 10/15 giving #7. [Create a gray image with g = 10, then multiply it and #6 with divisor 15]. The ratio 10/15 represents the scaling factor f in the first equation. It can be adjusted experimentally to give the most pleasing results.
8. Subtract #7 from #2 color map, giving #8.
9. Create a solid white image #9.
10. Subtract #2 color map from #9, giving #10.
11. Multiply #10 by #5, giving #11.
12. Multiply #11 by 10/200 giving #12. [Create a gray image with g = 10, then multiply with divisor 200]. The ratio 10/200 represents the scaling factor f in the second equation. It can be adjusted experimentally to give the most pleasing results.
13. Add #7 and #12, giving #13 - the shaded relief.
edit: corrected formula P1
#13
Posted 31 October 2009 - 03:47 PM
After making the hillshade in GRASS (exaggerating 4x, azimuth 315°, sun angle 75°) and exporting it to the GIMP, I have this:
shade_in.jpg 157.07K
142 downloadsThen I use the color curves tool to adjust the contrast. After setting a point at x=246,y=246 to fix this point I can happily edit the curve by dragging it, inserting more points to fine tune the resulting adjustment. All the while I get a live preview which I can switch on and off to check how my adjustment compares to the original image. I bet that Paintshop Pro has such a tool too, as any image editor must have which doesn't call itself MS Paint...
So applying this:
curves.jpg 55.17K
92 downloadsgives this:
shade_curves.jpg 167.13K
128 downloadsand finally adding another layer with the National Landcover and setting the layer mode to "Multiply" (again, if it isn't MS Paint it should have it...) gives this final result, which is pretty nice:
lc_blend.jpg 194.67K
166 downloads
http://wygoda.net
#14
Posted 05 November 2009 - 07:30 PM
...BUT...
I have a bone to pick with 315 degree azimuths, and this seems like a well informed audience that may have opinions.
If you or your audience has spent time in high latitudes, you probably won't like what google-style looks like in the far north. I know that we are supposed to have an easier time if the azimuth is 315 degrees, but when this is so far from the truth, I think it just gives more confusion.
Compare satellite and terrain images in google for Dawson, YT - their shading is completely flipped. Confusing, eh?
How about at exactly 45 degrees north, Mammoth, WY? - satellite and terrain are still really opposite.
So for the area around Mammoth WY, I created shading using a simple google-style method:
stdshade.jpg 151.75K
103 downloadsyeah, it looks okay, but it bothers me to see south facing slopes so dark!
So what if I just hillshade with an azimuth of 180 degrees (still a 75 degree sun angle)?
southshade.jpg 153.04K
106 downloadsIn my opinion this looks better, and similar to google-style since we have such a high sun angle.
But what if I take it a step further, using a realistic sun angle for the latitude and creating real shadows? can you understand this shading?
septrad.jpg 114.09K
100 downloadsI simulated incoming solar radiation in kilowatt-hours per meter squared for every hour of the 15th of september. Seems a little complex, but it is easy, I create them all the time in SAGA for science purposes. Most realistic for sure - I love how we no longer have as many artificial looking lines from the DEM. But is it the easiest to interpret?
Alternatively you could model the radiation of an entire year, but I think it gets washed out a little, and it takes way more processor time.
annradmz.jpg 108.93K
100 downloadsLet me know your thoughts on this. I want to kill the 315 degree rule, but don't want people to say my maps look inside out!
#15
Posted 05 November 2009 - 10:24 PM
Let me know your thoughts on this. I want to kill the 315 degree rule, but don't want people to say my maps look inside out!
I don't want to offend you, but.....you'll never kill that rule. Because it works. It works at high latitudes, at low latitudes, and on the moon. Tests have proven it.
And now for my own unpopular opinion: I think Google's relief is awful. Just compare it with any well-done 315 relief shading. Google has reverted shaded relief portrayal to the 19th century, before many successive generations of cartographers figured out what works and what doesn't. Just my opinion, of course.
Charles Syrett
Map Graphics
http://www.mapgraphics.com
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users


Sign In
Create Account

United States
Back to top
Spain
Canada
Germany








