Help needed: Viewing the world's map offline on Windows (32-bit)

Hi there hopefully helpful community!

My goal sounds simple:
I need a computer program that can be easily deployed/distributed that shows the complete openstreetmap on a (preferably 32-bit) Windows PC without internet access.*
(Some features like searching and customizing the view would also be nice but are not crucial.)

My research showed only two promising programs: Maperitive and gosmore.
On the osm-wiki site for Maperitive I can read: “It is suggested not to use very large areas because Maperitive loads all the data into RAM.” So it seems gosmore is the only usable thing.

Gosmore uses its own database file, *.pak, that can be created by rebuilding the database from an *.osm file. So i downloaded the Planet, got gosmore’s source as latest version from svn and applied the “patch” right at the end of the gosmore talk page to get it compiled. I then compiled it on a 64-bit linux machine (lubuntu), as you can read that 32-bit OSes fail with databases bigger than 2 GB and the windows versions of gosmore aren’t even able to rebuild the database.

I tried to rebuild the database as proposed in the rebuild guide like so:

bzcat planet-######.osm.bz2 | gosmore sortRelations >/dev/null
bzcat planet-######.osm.bz2 | gosmore rebuild

The first command takes about 90 Minutes and works well. It creates the relations.tbl with a size of ~5.2GB. The second command output some code, the last line was “1 while (xmlTextReaderRead (xml) == 1)” and after a few hours it finished without any more output. The output should normally have been longer. I tried launching gosmore, but it segfaults immediately with that database.

I’m doing the same again (sortRelations and rebuild), as I’ve got the impression that something went wrong during the first “sortRelations”. But even if all works well I’m not sure 32-bit OSes will be able to use the *.pak database generated by a 64-bit OS. Another thing that arouse my attention was that on the gosmore wiki page, section “building your own pak file”, it says “using country extracts is strongly advised”. Why?

Now my main questions:
Does anyone have a hint to help me build that database? (Has anyone ever managed to build it for the complete planet?)
Does anyone have a better idea than using gosmore for my goal (see top of post), possibly without the necessity of using 64-bit OS?

If anyone can help me, i’d gladly appreciate it!

Thanks in advance,
linerider


  • Background: My sister works and teaches temporarily (for 2-3 years) at a university in Cameroon. She lately visited me and from all the stories she told me regarding education it came out that one of the main problems is that access to information is very difficult. Most people do not have computers, even fewer do have Internet access. (Even the students! Once she wanted to work with computers and asked if the students could bring their or a borrowed laptop. It turned out only one of 40 students had access to a portable computer.)
    The computer science students have tasks like e.g. program traffic lights for crossroads. Problem is: Most of them have never seen traffic lights hence they don’t know what they are used for or what meaning the different colors have or in what sequence they should light up. And they do not have access to wikipedia to look that up. In addition, there is no book library.
    So we thought about how we could improve access to knowledge that we benefit from every day. It makes sense to use free software and data as it can easily be distributed and does not have any real weight that has to be transported. We figured the most important things would be an encyclopedia, dictionaries and geography. So we downloaded Wikipedia (made available off line with Kiwix), some free dictionaries (with free software) and now: openstreetmap.

Here comes an update:

The creation failed again but with some more Info:

  • After some time gosmore printed “*** Warning: Too many styles !!!”

  • I monitored the progress and around the time it should be finished the system got unresponsive (couldn’t even move the mouse pointer normally).

  • When that happened the USB flash drive I booted lubuntu from showed activity all the time.

  • It tried to login via ssh but it was very very slow.

  • After some time gosmore was killed.

  • dmesg gives me:

    [106385.837858] Out of memory: Kill process 25730 (gosmore) score 925 or sacrifice child
    [106385.837859] Killed process 25730 (gosmore) total-vm:20644964kB, anon-rss:14527180kB, file-rss:1104kB
    

    (Is gosmore really using 20 GB ob virtual memory whereof 14.5 GB are in RAM? The machine has 16 GB so it’s possible…)

I think I’ll retry by installing lubuntu to a hard disk drive and try again.

In the meantime you are welcome to give any hints, especially if you know something that better suits my needs than gosmore. And preferably something that works out of the box :wink:

All the best,
linerider

I can recommend to do a search for “offline” at http://help.osm.org … there should be some answers to questions similar to yours.

Be aware: Maperitive is mainly a rendering program, not an offline viewer in the first line.

Some spots that I can name you:

try someting that is based on http://wiki.openstreetmap.org/wiki/Mapsforge … maybe http://wiki.openstreetmap.org/wiki/Atlas_(navigation_application)

Looking at http://wiki.openstreetmap.org/wiki/Offline_Openstreetmap shows me that many apps mentioned there seem to be no longer under active development :frowning:

Maybe using Osmand is an option: apparently you can make it run on a pc too. See http://forum.openstreetmap.org/viewtopic.php?id=27125

Thanks for your answers!

I found some helpful info there, but it seems gosmore is still the way to go. Possible candidates and what I found about them:

marble - “It’s a bit slow (only use small extracts) and not as pretty as a mapnik rendering, but it works.” :expressionless:
Atlas - Based on java :frowning:
Mapsforge - interesting, but also for java (or android) :frowning:
NaviPOWM - Looks interesting, but data format seems strange. You have to download and extract tons of .7z-files: http://dev.openstreetmap.de/navipowmmaps/navipowm/planet/ :confused:
MapFactor Navigator Free - Is too focused on navigation… :frowning:
GpsMid - Java :frowning:
gpsVP - only OSM tiles or garmin format supported (there is no garmin format world map AFAIK) :frowning:
Navit - only for linux :frowning:
MoNav - Promising, but seems complicated and I found no info about how it performs on large map files (planet). Last version is from 2011. :slight_smile:
Gosmore - “very fast vector display, also search function included” :smiley:

Java is problematic because it has to be kept up to date for security reasons. So it’s not wide spread where this software is to be used because Internet is a rare resource in Cameroon.

Yeah that’s true. “Nobody” needs something like this because “everybody” has Internet access. All the time. Everywhere. sigh

It tried that and it’s not. First of all Android on x86 is very slow in a VM but OsmAnd is even slower. Also there are some issues with the virtual machine that have to be taken care of (internet access, power on device…)

I made another approach to rebuild gosmore’s database. This time with a much slower machine as the fast one wasn’t available but with an installed and up to date version of lubuntu (NOT booted from a usb flash drive but from hard disk). So far it runs fine but it’s running for ~48 hours by now. If it fails (again) I will retry on the fast machine with 16G of RAM. If that fails I will have an in-depth look at MoNav and NaviPOWM. I tried marble before and was unable to cope with it. It seemed too complicated.

I’ll report!

Nope.

The reason why Java is a security issue is that through the browser-plugin a random website might get the same privileges as a normal application. So if you don’t have internet access anyway, it’s far more important to keep the OS up to date. When you do have internet access don’t install the browser-plugin and handle java-applications like any other application.

I was blind! Now I can see! :smiley: Thanks for pointing that out! I will have a look. (Hopefully tonight.)

The computers at the university (and some people owning computers) do partially have Internet access, but very low bandwidth. Their maintainers try to keep the OS up to date, but any extra updates are frowned upon. Telling everybody not to install the browser plugin is difficult. Apart from that the computers at the university don’t have java and the administrators would rather not have to install and maintain it.

Again, thanks for the input. If everything goes well I’ll have a *.pak file for gosmore tonight. I’m hoping to be able to share it with the community, hopefully hostet at the university I’m studying at.

¿Garmin BaseCamp + some OSM compliled for Garmin like http://garmin.openstreetmap.nl/ ?

Thanks, muralito, but my goal is to have the complete planet available. As I understand it, the garmin type maps that BaseCamp uses are only available for relatively small parts of the world. Correct me if I’m wrong, but there seems to be no way to open the whole planet with BaseCamp.

I have to admit I didn’t try it but that’s what I read so far. I’m testing the most promising software first.

Off topic: I can’t help but wondering why you would try to cram all that OSM data that allows you to navigate from e.g. Reet to Boom on a 32-bit computer for people in Cameroon. So my first question would be: How will they use the OSM data ? To navigate in their country ? To learn about countries and their capitals and the main rivers in the world ?

Do they really need to know all the shops in a remote town on the other side of the planet ? My first goal would be to reduce the data to what they actually going to use. Then try to find a program that can handle that data.

Alright, I guess I’m giving up on gosmore, at least with the complete planet file:

  1 while (xmlTextReaderRead (xml) == 1)
*** Warning: Too many styles !!!
nOther=-1777845569 FIRST_LOWZ_OTHER=1996488704
  2 while (fread (&nd, sizeof (nd), 1, groupf[i]) == 1)
  3 while (fread (wp, sizeof (wp), 1, groupf[i + NGROUPS]) == 1)
Speicherzugriffsfehler (Speicherabzug geschrieben)
# 'Segmentation fault (core dumped)' in english

This happened after ~19 hours. 16 GB of RAM, ~10GB of Swap (possibly more, didn’t monitor that all the time) and ~130GB of *.tmp files were used.

IMO this is completely ON topic because it possibly helps finding a better solution. You are right, they do not need to navigate and they do not need the location of shops etc. You described it quite good: “To learn about countries and their capitals and the main rivers in the world”.

I hoped there was an easy solution. Installing gosmore and rebuilding its database from the planet file seemed doable and not much effort (except for the pitiful computer doing it) but obviously I was wrong.

Unfortunately I do not know how to reduce the data. It seems http://wiki.openstreetmap.org/wiki/Osmfilter will do the job. It’s obvious that e.g. amenity=bench or natural=tree (over 1 million!) could be excluded and highway=* should be included (over 80 million) but how do I decide what’s relevant and what’s not? Any ideas?

I guess the next thing I’ll try is MoNav.

Take a look at http://www.naturalearthdata.com/features/ , maybe that is more suitable for your goal

Great has the same problem. Someone deleted my question. Was too simple I guess. Well no simple map viewer / offline Google maps here.

If someone posts a simple question that has already been posted in a thread like here where there is no answer whatsoever… problem not resolved and someone re-posts the quetion… what do you so?

You delete the question. No simple answers on this forum! Hell no! this a forum for nerds, only tech babble here…

Someone emailed me with the following question that seems to fit here:

Hello!
I want use Gosmore on windows with map of Belarus.
But I can't convert map from openstreetmap.org/export to Gosmore format.
I have Minsk.osm and minsk_belarus.osm.bz2 files. When I try use:
C:\Program Files (x86)\Gosmore>Gosmore osm -dc E:\OSM\Minsk.osm | gosmore rebuild

or

C:\Program Files (x86)\Gosmore>Gosmore b2zip -dc E:\OSM\minsk_belarus.osm.bz2 | gosmore rebuild

I have got next result:

...
248 halfSegType *seg = (halfSegType *) mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fileno (groupf[i]), 0)
249 halfSegType *seg = (halfSegType *) mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fileno (groupf[i]), 0)
250 halfSegType *seg = (halfSegType *) mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fileno (groupf[i]), 0)
251 rewind (groupf[i])
252 rewind (groupf[i])
253 rewind (groupf[i])
254 rewind (groupf[i])
255 rewind (groupf[i])
256 rewind (groupf[i])
257 rewind (groupf[i])
....
488 for (pairs = 0; pairs < PAIRS && s2grp < S2GROUP (0) + S2GROUPS; )
489 for (pairs = 0; pairs < PAIRS && s2grp < S2GROUP (0) + S2GROUPS; )
490 for (pairs = 0; pairs < PAIRS && s2grp < S2GROUP (0) + S2GROUPS; )
491 for (ndType *ndItr = ndBase; ndItr < ndBase + hashTable[bucketsMin1 + 1]; ndItr++)
492 qsort (&lseg[0], lseg.size () / 2, sizeof (lseg[0]) * 2, (int (*)(const void *, const void *))HalfSegCmp)
493 for (int i = 0; i < IDXGR[/quote]OUPS; i++)
C:\Program Files (x86)\Gosmore>

I don't see errors in this result, but and map I don't see too.
Help me pleas, how open map of Belarus in Gosmore?

Do you see a ‘gosmore.pak’ in the same directory where gosmore.exe is?

Where I can get ‘gosmore.pak’? I download only Gosmore.exe on http://sourceforge.net/projects/gosmore/.

Gosmore.pak is the resulting file from the Gosmore rebuild process. It is the file containing all the data for the route calculations and screen information.