[OSM-talk] Own maps with hill shading and routes using mapnik

Andy Allan gravitystorm at gmail.com
Sun Sep 14 12:25:09 BST 2008


On Sun, Sep 14, 2008 at 11:58 AM, Frederik Ramm <frederik at remote.org> wrote:
> Andy Allan wrote:
>>
>> It's a pity, but I don't know of any void-filled data that's under PD
>> license or any open-source void filling code at the moment.

[rearranging your questions]

> Are you using non-void-filled data for the cyclemap then?

Yes, unfortunately. Most of the delay to hill colouring was trying to
fix this, but eventually I just went for it irregardless. But then you
get areas like this:
http://www.opencyclemap.org/?zoom=13&lat=46.38147&lon=8.82287&layers=B000

> Have you looked into this deep enough to give us a quick rundown of where
> the difficulties are?

It's a rabbit-hole of increasing complexity, but there's various
levels to it and some can be picked off easily.  Very small voids
(~4-10 pixels) can be filled algorithmically by interpolating (or
"smoothing") across the gaps.

Bigger voids get more complicated, and filling them 'correctly' gets
tougher. The biggest 'voids' are outwith the band of coverage (i.e.
north of 60N) and so another dataset is needed. The GTOPO30 is the
most likely, but has a much lower resolution. I haven't had a chance
to look into it fully, but I suspect it will be usefull for colouring
and shading, but not for contours.

Big voids, e.g. the alps, can't just be "smoothed" over.
Intermediate-sized voids could be filled with image-cloning techniques
to make a synthetic landscape. It's fake, but realistic looking. At
the upper end of the voids (like the illustration above) then using
GTOPO30 could anchor the fake landscape to reality, but it's still
pretty fictional. The big problem with this is it's just
image-processing, so it can make impossible landscapes like joining
hills together and therefore cutting off valleys.

There are two 'ultimate' answers. Firstly is better DEMs, which might
be available (I think Canada just released some DEMs into PD which
would be fantastic if true). It's how Google have dealt with
switzerland, by replacing SRTM with another DEM that they presumably
paid for. You can spot the borders between them e.g. at
http://maps.google.com/?ie=UTF8&ll=46.246499,6.811137&spn=0.014364,0.038581&t=p&z=15
(SRTM is on the left).

Secondly is hydrographic-model approach, which is what I believe the
GGIAR guys do, and it's how voids are traditionally filled by the
professionals (generally manually or at least labour-intensively, not
like us upstarts who just think on a fully automated, global basis ;-)
). If you have all the rivers you can constrain your filling
algorithms to make sure the resultant landscape involves the rivers
going downhill! So we've looked at how the river coverage in OSM
compares to the voids, but at the moment they don't overlap so it's
not much help to us.

Perhaps not a quick run-down then ;-)

Cheers,
Andy




More information about the talk mailing list