Further Adventures in Hillshading

Posted by asciiphil on 18 May 2010 in English (English)

At the suggestion of a comment on my last diary entry, I decided to experiment with putting the hillshading information in the alpha channel of an overlay for the rest of the map, more or less as described in .

I also tweaked some of the other settings. I toned down the relief colors. There's still a visual distinction between various elevations, but the background colors don't interfere as much with the foreground colors. I also reorganized some of the rendering layers. I'm rendering things in this order: color relief, landarea/landuse, contour lines, water bodies. I think this ordering gives a nice indication of both elevation and landuse without either interfering with the other.

Finally, I found the scaling=bilinear8 option for Mapnik's RasterSymbolizer, which gives a lot smoother hillshading; the shading now looks good down to zoom 16 or so, and passable all the way down to zoom 18.

Here's one of the rendering areas from the last diary entry under the new rendering rules, both with and without the hillshading:

Patapsco River, New Rendering

Patapsco River, No Hillshading

I also like this rendering of Hoyle Crest, the highest point in Maryland:

Hoyle Crest

I still have some problems I need to work out. In some areas, the hillshading pretty much obscures the map below it, as in this area along the Virginia/North Carolina border:

Shaded Mountains

I'm considering making an additional overlay that just has place labels (and possibly road shields) and putting that overlay on top of the hillshading.

I also need to figure out a better way of getting coastline data into my rendering. The standard approach is to make the map background the color of water and then draw the polygons from the coastline shapefiles as the color of land. I have to use the color relief image as my background, so the standard approach won't work for me. For the moment, I've hacked around the problem by coloring 0-meter elevations as water, but the NASA data's coastline clipping doesn't always match OSM's. There's also the problem that OSM uses coastlines for things like the Great Lakes, which aren't at sea level at all, so my current rendering just shows them as large, flat areas of land.

Finally, there's the matter of holes in the NASA elevation data. There are a lot of small to medium gaps, which with my current process, end up at sea level (and thus get colored as water). There are also some really large holes, like this one near the North Carolina/South Carolina border:

North Carolina/South Carolina Hole

When I looked around for information about filling voids in elevation data, I saw a lot of mentions of the CGIAR-CSI dataset, which used a variety of techniques for filling in voids in the SRTM dataset. I'm downloading CGIAR-CSI data for the US now, and I'm going to experiment with using it instead of the raw SRTM data. (More properly, I'm going to try using it in addition to the SRTM data; the CGIAR-CSI data has a resolution of three arc-seconds, while the SRTM1 data has a resolution of 1 arc-second for the US, so I'd like to use the higher-resolution data where possible and only fall back to the lower resolution data as needed.)

Comment from JimmyRocks on 18 May 2010 at 15:21

Really cool stuff, I was going to suggest to look at how OpenCycleMap deals with the missing data, but it appears they have missing data as well (

Hide this comment

Comment from Andy Allan on 18 May 2010 at 16:50

Watch out with what you do with the CGIAR dataset, since it can't be combined with OSM data. What you're doing with overlays is OK, but it's a dead-end path if you try doing anything more interesting.

Hide this comment

Comment from iandees on 18 May 2010 at 17:02

Have you seen Lars Ahlzen's TopOSM stuff? I'm working with him on covering the entire US with TopOSM right now. Looks like you guys might be duplicating effort! and

Hide this comment

Comment from Ethan O'Connor on 23 May 2010 at 02:17

Have you looked at using the National Elevation Dataset instead of SRTM data? There are no gaps in coverage across CONUS, AK, and HI, It's available in 1/3rd arcsec for most of the US (1/9th for ~10% of the US), and it is quality controlled and frequently updated. In fact, they updated tiles covering about 10% of the US this past December, 6% in February, and another 11% this April!

It is a USGS publication, compiled from USGS and other US Government Publications (including SRTM in parts of AK), so it should be fine for any OSM use.

Hide this comment

Leave a comment

Parsed with Markdown

  • Headings

    # Heading
    ## Subheading

  • Unordered list

    * First item
    * Second item

  • Ordered list

    1. First item
    2. Second item

  • Link

  • Image

    ![Alt text](URL)

Login to leave a comment