Offline hill shading

355 views
Skip to first unread message

yvecai

unread,
Oct 31, 2011, 11:15:48 AM10/31/11
to osm...@googlegroups.com
For now, the best way to have hillshading and contour lines in OsmAnd is
to download tiles from server like CycleMap or else.
When downloading for offline usage, it just take them a lot of bandwidth
for tiles that you will never look at.

Contour lines are easily vectorized, and I'll make a try to get 20m .obf
files available.

For hillshading, it's raster images. SRTM resolution allow to create
hillshading at zoom ~11, below it's only resampling. A complete tileset
from zoom 0 to zoom 11 takes 22GB in png tiles.
On my webserver, I use a python script to resample tiles from zoom 11 to
serve zoom 12 and onwards. This resampling work could be done by OsmAnd
offline form a sqlitedb of tiles, I think.

Any takers to add this feature in OsmAnd?

I can provide a 63MB zip file for Gtopo30 tiles (z0-7) and a 22GB
(z-0-11) SRTM tiles, along with my resampling script upon request if
somebody wants to jump in.

Yves

andre van atten

unread,
Oct 31, 2011, 11:37:26 AM10/31/11
to osm...@googlegroups.com

Wow!

That is great. I suggest be create a
sqlite databases with png tiles to level 11 from cyclemap for every country, of course in conjunction and agreement with the people from cyclemap. We make those downloadable from within Osmand app.
It would be great if these could be used in osmandmapcreator to resample them to level 12 and higher, and add contourlines from vector obf.
In that case we will become champion in offline data, vector and tiles, and OSM people will be very happy we do that to solve their server capacity issues. You see, people from Mobac only matter about the software, we should go for the complete solution, software and data!

Btw I am very interested in the 22 Gb dataset. Can you mail them to me ? ;-)
I think we should create sqlitedb packages from them per country or part of country. I can do that. Lateron we can provide the other zoomlevels. The packages have to be zipped to 100mb units, and Osmand should be able to download and unpack them and put the in the right place (Osmand tiles map , in the root).
@ Victor: can we do that? Do you like the idea?

Andre

Op 31 okt. 2011 16:15 schreef "yvecai" <yve...@gmail.com> het volgende:

yvecai

unread,
Oct 31, 2011, 12:29:02 PM10/31/11
to osm...@googlegroups.com
Andre, see my MP on for the tile files.
YES, we can resample with hillshade tiles, but NO, not with a complete map like CycleMAp. By resampling, I means like in gimp when you enlarge an image! This is what is done with hillshading, but won't work with roads and contour for obvious reasons.
Also, I don't think resampled tiles should fit in a sqlite db, it would be enormous and a complete waist of SD! This should be done on the fly by the phone.

Yves

Victor Shcherb

unread,
Nov 1, 2011, 6:54:26 PM11/1/11
to osm...@googlegroups.com
Actually that is good to see that data and to use it.

But unfortunately Osmand can elaborate maintain everything that's why it has wide API to support external services :)

So I will not be able to maintain that resources for user sharing on download.osmand.net servers. As well as creating binary files of altitude lines.

I would prefer to have good instruction how to create the altitude lines file that Andre has already started actually in How to.
But is probably good to have separate page. Many people are interested in that functionality relief/altitude lines that's why I'm always keeping that issue open http://code.google.com/p/osmand/issues/detail?id=447&colspec=ID%20Type%20Status%20Priority%20Summary%20Opened%20Milestone but it is good to probably move everything to one place in Osmand Wiki.

I feel good enough to download big file with some SRTM or probably with already generated obf files and support it as torrent sharing but it is not feasible to do on the server. And I don't feel that I can maintain obf generated files for regions.

Feel free to ask about solving issues and on my point we need to share our knowledge and put it very visible.

Victor

2011/10/31 yvecai <yve...@gmail.com>

andre van atten

unread,
Nov 2, 2011, 4:08:22 AM11/2/11
to osm...@googlegroups.com

To Victor, Yves and Lukas,

My idea is to maintain one download place for raster maps.

1. Normal OSM mapnik tiles. This is the first step. Lukas is setting up the server and in 2 weeks we can test it. We can set up Osmand source for Mapnik tiles as a second source in the xml file, and eventuality later as default source. At the same time we can setup OsmandMapCreator so it takes it download tiles from Lukas server too. Only thing you have to do Victor , is adding tile source to the 2 xml files for Osmand and mapcreator. Would you do that?

2. Mapnik tiles in sqlitedb packages ready to download. I now only can create these manually with osmandmapcreator, but we need some script that is able to create these packages automatically. I am thinking of predefined tile blocks of about 100 MB, starting at 1 tile at level 7 or 8 and all underlying tiles in higher levels.@ Yves, maybe you are able to create a python script to do so? You are very clever with server side scripting. You can look into Osmandmapcreator code and sample sqlitedb file to see how it works.
To prevent the need of a download index in Osmand app, which need a lot of maintenance and coding for victor, I am thinking of a link in Osmand and Osmand mapcreator to a simple html file with links to the packages, Maybe in map form.@ Victor : If that is the only thing I am asking, would you like the idea?

3. The same for hillshade tiles in sqlite format. This only needs one time creating, because mountains and hills won't walk away next 100 years. The same for creating one time srtm contourlines in obf vector format. Unless format is changing, it can sit on the server for years.

How do we think about that? Are there any members in the group wanting to help with creating scripts and bots to do so?

The use of all this work: While OSM has managing problems to deliver bandwidth for tiles, we should be the number ONE in offline maps. People are willing to use tile packages in sqlite format because it is fast and convenient, and when going on holidays a nice alternative beside the vector format. Especially hillshade maps, because there is no alternative in vector :-)
After the first start there can be lot of ideas like creating packages with openbusmap, opencyclemap and openwhatevermap, because there is no vector alternatives till now. But let us see how far we can come with these ideas.

At the end, OsmandMapcreator is nice, but on global scale it is awful inefficient and energy consuming if anyone has to download his own tiles and creating offline packages of it. When you see how popular Mobac is, we can get a lot of users from mobile atlas creator and all the apps it is serving to Osmand. Osmand as one stop shop. Why need anything else?
Who wants to join and start building it? We can start with a wonderful opportunity of a server to start with.

In the mean time I am challenging anyone who is willing to start with creating a pc based java version of Osmand that uses the obf format, to give it a try. So get rid of those tile servers. Tiles are so 20'th century ;-) !

Andre

Op 1 nov. 2011 23:54 schreef "Victor Shcherb" <victor....@gmail.com> het volgende:

Yves

unread,
Nov 2, 2011, 7:40:43 AM11/2/11
to osm...@googlegroups.com
Im'in.
For the sake of my curiosity, what are the extent and zooms available in 100mb db?
--
Envoyé de mon téléphone Android avec K-9 Mail. Excusez la brièveté.


andre van atten <andrev...@gmail.com> a écrit :

andre van atten

unread,
Nov 2, 2011, 8:55:51 AM11/2/11
to osm...@googlegroups.com
Hi Yves,

I still have to figure this out. Depends also on the lowest and highest level and the complexity of the png files. One-color files are smaller.
But I am working now ;-), so can't spend time now.
I have a file of the whole earth just 99Mb and is level 0-6 or 7 , not sure. So we have to look what is a good solution, e.g.:

level 1-7 worldwide 1 file
level 8-14 starting from tile level 8
and/or
level 11-18 in area from tile level 18
or 
level 8-18 in area from tile level 11

Maybe we have to adapt settings. An alternative is to make small and big packages (100 or 1000Mb).  I have a 1000Mb package and it works fine ;-)
Just trying and experimenting phase now !

Andre

2011/11/2 Yves <yve...@gmail.com>

yvecai

unread,
Nov 2, 2011, 2:08:29 PM11/2/11
to osm...@googlegroups.com
Ok, 1 tile is approximately 1x1° at zoom 9.
Let's put 5Ko per tile:
Zoom    tile number    size
9    1    5    Ko
10    4    20    Ko
11    16    80    Ko
12    64    320    Ko
13    256    1 280    Ko
14    1024    5 120    Ko
15    4096    20 480    Ko
16    16384    81 920    Ko
17    65536    327 680    Ko

Such db are feasible, but when you do the count for maintaining a downloadable set for the all world, I have quite a doubt.

For instance for the SRTM hillshade set:
We have zoom 11~ 20Go so:
11    21    Go
12    105    Go
13    525    Go
14    2 625    Go
15    13 125    Go
16    65 625    Go
17    328 125    Go

65 To for zoom 16. Are you sure we can afford this storage space? Definitely vectors are good for ways, and a resampling should be implemented for hillshade if you want them online + world-wide.

Yves

andre van atten

unread,
Nov 2, 2011, 3:47:18 PM11/2/11
to osm...@googlegroups.com

Hi Yves,

I think resampling should be done for hillshading in the app, so in Osmand itself. In that case Osmand takes the tile with highest zoomlevel 11, and stretches it out memory when needed. Takes no storage space, and stretching goes on the fly, so resampling and packing the resampled file is not necessary.

The world mapnik tiles: I strongly doubt that will take so much space like you calculated 330 TB. Lukas is implementing to render all OSM mapnik world tiles, he will be able to answer the question how much TB it takes. When zooming in most tiles will have 1 color, and you don't need all the ocean tiles at zoomlevel 19, in that case you can use one tilenotfound replacement tile in code.
Packing it in sqlitedb format will be roughly the same space, but because it takes no filesystem slack it will be about 50 -70% of harddisk space it takes, while the amount of bytes in the data is about the same. And yes, tile packages still do take a lot of disk space, but has advantages too: it takes less battery power and memory. Second advantage is that coastlines are difficult to render for Osmand because they are not in OSM data format. Mapnik renders them from shape files. Don't ask me why OSM never changed this, it has always been so. But the result is that in places on the world with lot of islands areas look like flooded. Which is in reality too often the case btw. Countries like Greece are causing problems in Osmand (and not only in Osmand ;-)

@ Lukas,

Can you estimate the amount of space tiles are taking, for the world or for each continent (or country)? I understand you have already tiles for Central Europe. How much is taking on hard disk space?

Andre

Op 2 nov. 2011 19:08 schreef "yvecai" <yve...@gmail.com> het volgende:

yvecai

unread,
Nov 2, 2011, 4:11:44 PM11/2/11
to osm...@googlegroups.com
Hi Andre,
I don't have tiles on my server except hillshade and a contour DB,  I use OSM tiles as background map at www.pistes-nordiques.org. To say it all, I do have a daily update planet.osm file to extract the crosscountry pistes.

Anyway you are right, I took the wrong figure, an average tile is 663 bytes. That's 54 TB anyway: http://wiki.openstreetmap.org/wiki/Tile_Disk_Usage
There is others solution too: one can imagine a rendering queue where people can request to the server a tile package to download or something like that. Tile packages could be kept in cache for a while depending on server storage capacity and package freshness.

Yves

andre van atten

unread,
Nov 2, 2011, 4:18:21 PM11/2/11
to osm...@googlegroups.com

Yes,

And I think it is rather easy to define first the hot places, which are areas that are interesting because a lot of people live using smartphones and computers, or because they are tourist hotspots.

Andre

Op 2 nov. 2011 21:11 schreef "yvecai" <yve...@gmail.com> het volgende:

yvecai

unread,
Nov 2, 2011, 4:37:12 PM11/2/11
to osm...@googlegroups.com
Nice system to set-up :) Something like www.maposmatic.org, any web-dev in the room?
Yves
Reply all
Reply to author
Forward
0 new messages