maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Downloading Maemo Mapper maps on PC, is it possible? (https://talk.maemo.org/showthread.php?t=29365)

cquilliam 2009-06-04 19:41

Downloading Maemo Mapper maps on PC, is it possible?
 
In a couple of months, i'm taking a trip to Toronto, Ontario for a week or so. I will be spending a lot of time walking around, and would love to take my N800 and GPS to help me find my way around. What I want to do is pre-load the maps needed (preferably levels 4/6 of google street for the downtown area).

I have tried doing it inside of Maemo Mapper, by displaying the general area I want, going to Menu->Maps->Manage Maps set it to Download Maps, By area, and set it to zoom levels 4 and 6. The downloads begin, but one of two things happen every time I try this. Either A) The wireless disconnects and reconnects constantly, or B) The tablet resets itself. Its almost as if it can't handle that much data coming to it.

I would like to make the downloads on my PC and transfer them to the tablet using my 16GB sd card. Is this possible? I've done some searching and googling, and the only thing I can find is "WinMapper 03.19.2009". I've followed the instructions by using google earth to create the two KML files for top-left and bottom-right, added it into the program, but when i click "Download", a second passes and then it says "All Done!" with obviously not downloading anything.

Any suggestions for either problem?

ioan 2009-06-04 20:01

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Winmapper is broken.
I didn't have time yet to convert the application to work with the new maemo-mapper. The source code is included in the zip on the website, so if somebody else makes the changes to work with the new version of mm, I will be happy to compile it.

When I get some time on my hands, I'll do it. I have a 6 monts old baby girl... so is kind of hard to take care of my pet projects right now.

Lord Raiden 2009-06-04 20:07

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Edit: NM. Looks like ioan beat me to it. lol.

BTW ioan, congrats dude! :D And if you have a few minutes and can explain how the gps data correlates to the image addressing system, plus how db entries should be loaded into the sqlite database for MM, I think one of us could possibly whip up something.

ioan 2009-06-04 20:32

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Quote:

Originally Posted by Lord Raiden (Post 293778)
BTW ioan, congrats dude! :D

Thanks! She's very sweet:
http://picasaweb.google.com/kimberly...59970766937570

Quote:

And if you have a few minutes and can explain how the gps data correlates to the image addressing system
Well, this is the problem. The new maemo-mapper changed the way how the coordinates are calculated and/or there are some extra zoom levels (?) ... this is where a fix is necessary. I made the original winmapper by converting C code from mm source to Delphi, probably this is the best way to find a fix too.
The problem is somewhere in main.pas, between the lines 126 and 235.

Quote:

plus how db entries should be loaded into the sqlite database for MM, I think one of us could possibly whip up something.
The database support is already in. Winmapper already writes the tiles and the coordinates in a db that is compatible with mm, the problem is that the new mm doesn't understand the "old kind" of coordinates I'm witting in.

Lord Raiden 2009-06-04 22:26

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Ah, ok. So what's up with the "out of range" error that occurs when trying to download maps? Is that involved with the problems around like 126-235?

ioan 2009-06-05 17:02

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Quote:

Originally Posted by Lord Raiden (Post 293820)
Ah, ok. So what's up with the "out of range" error that occurs when trying to download maps?

I never got that error. Can you tell me the steps to reproduce the error?
Thanks.

Lord Raiden 2009-06-05 18:32

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Yeah, just open the app, specify your coordinates per the gps coords listed in maemo mapper, and press download. It then errors out.

EDIT: Ok, I tried it again and the exact error was "TProgressBar property out of range".

Sencer 2009-06-07 14:04

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
1 Attachment(s)
Hello,

My husband made a python-skript for me (see attachment) for downloading google street maps into a sqlite3-db. Works fine. You need Python 2.x und PySQLite 2.x (http://oss.itsystementwicklung.de/trac/pysqlite/) for running.

Lord Raiden 2009-06-08 00:28

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
That's awesome, save for two questions. 1) Is the database it creates readable by Maemo Mapper, and 2) does it do VE Street maps? I don't use the google ones as VEStreet has far more detailed maps with much, much better labeling.

Sencer 2009-06-08 10:06

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Yes the database works for Maeno Mapper, ist written only for this case. But it doesn't work with VEStreet.

Lord Raiden 2009-06-08 13:44

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Actually, now that I look at the code, it should work for any of the map URI's. I may not understand python all that well, but I understand enough to realize that a few tweaks would make this usable for anything. :) Thanks Sencer!!

Mara 2009-06-08 14:04

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Quote:

Originally Posted by Lord Raiden (Post 294625)
Actually, now that I look at the code, it should work for any of the map URI's. I may not understand python all that well, but I understand enough to realize that a few tweaks would make this usable for anything. :) Thanks Sencer!!

yeah.... it could be as simple as changing one line containing the map source URL. That seem to be on line 20.

And if someone has more time... maybe all map repositories can be added and add few new lines of code to allow selection of what maps to use.

Lord Raiden 2009-06-08 19:16

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Ugh, I'd love to do that for you, but again, I don't know python all that well. Otherwise I'd already have done it. Hmmf. Maybe this is finally an excuse for me to get around to learning Python. ;)

Laughing Man 2009-06-08 19:26

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Hmm have you tried using this with existing map databases so a new one doesn't have to be created?

Sencer 2009-06-08 21:30

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
It also works with an existing sqlite3-database used by maemo mapper.

Lord Raiden 2009-06-08 22:40

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Woohoo! :d

Laughing Man 2009-06-09 03:41

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Hmm...

Code:

./getmaps -t 35.231844 -b 38 -l -80.895381 -r -81 -z 6 GStreet
You asked for 3150 tiles
Traceback (most recent call last):
  File "./getmaps", line 179, in <module>
    main()
  File "./getmaps", line 168, in main
    loadTile (db, x, y, zoom, i, numTiles)
  File "./getmaps", line 88, in loadTile
    if (tileExists (db, x, y, zoom)):
  File "./getmaps", line 75, in tileExists
    % (zoom, x, y))
sqlite3.DatabaseError: file is encrypted or is not a database

Tried renaming GStreet into GStreet.db and it still didn't help.

qviri 2009-06-09 04:18

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Laughing Man, file/access permissions?

Sencer 2009-06-09 04:48

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Uh, sorry, i think i misunderstood you. you cannot convert an "old" (non sqlite) database from mapper. an sqlite-database has the ending.sqlite not .db.

Sencer 2009-06-09 09:38

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Laughing Man: Try "getmaps <dbfile> [options]"
The help is wrong in this case... sorry! (normally it doesn't matter where you place the options but it seems it does in this script)

Here is a demo:
./getmaps test.sqlite -t 68.78825 -l 17.00327 -b 62.50560 -r 15.6039 -z 9 -z 8 -z 7 -z 6 -z 5

Laughing Man 2009-06-09 20:21

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Quote:

Originally Posted by Sencer (Post 294872)
Uh, sorry, i think i misunderstood you. you cannot convert an "old" (non sqlite) database from mapper. an sqlite-database has the ending.sqlite not .db.

Sorry, I used the wrong file ending (a bit of a newbie with that). But my database is in sqlite form.

Quote:

Originally Posted by Sencer (Post 294921)
Laughing Man: Try "getmaps <dbfile> [options]"
The help is wrong in this case... sorry! (normally it doesn't matter where you place the options but it seems it does in this script)

Here is a demo:
./getmaps test.sqlite -t 68.78825 -l 17.00327 -b 62.50560 -r 15.6039 -z 9 -z 8 -z 7 -z 6 -z 5

Hmm I tried the (same) command again that gave me an error the first time and it works now. How odd. The only difference from before and then is a PC reboot (well shutdown at night and turn back on in the afternoon). *shrugs*

It works. :D

grog 2009-06-10 14:54

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Quote:

Originally Posted by Sencer (Post 294443)
Hello,

My husband made a python-skript for me (see attachment) for downloading google street maps into a sqlite3-db. Works fine. You need Python 2.x und PySQLite 2.x (http://oss.itsystementwicklung.de/trac/pysqlite/) for running.

Thanks for sharing the script, Sencer. Works great & lead me to finally convert to using SQL db's which I never bothered to before now. BUT :), has anyone else noticed that the zoom levels seem to be off? With my old db I would normally zoom my maps to level 5 when walking, but now I find to get the same detail I have to go to 4 (somewhere between 3 & 4 actually). The names & labels also seem to be smaller (it's not just my eyes, which it could have been since I just has laser correction last week, but it's not)

Not a biggie, just curious. TX

Lord Raiden 2009-06-11 01:37

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Nah, I hadn't noticed anything different.

Laughing Man 2009-06-11 02:27

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Hmm, and I messed up my earlier post. I forgot to rename GStreet.db back to GStreet so the command works (regardless of if you put the database file first or last in commands) with a fresh file. But without a file it still says.

Quote:

vforviktor@vendetta:~/Scripts$ ./getmaps GStreet -t 68.78825 -l 17.00327 -b 62.50560 -r 15.6039 -z 9 -z 8 -z 7 -z 6 -z 5
You asked for 951792 tiles
Traceback (most recent call last):
File "./getmaps", line 179, in <module>
main()
File "./getmaps", line 168, in main
loadTile (db, x, y, zoom, i, numTiles)
File "./getmaps", line 88, in loadTile
if (tileExists (db, x, y, zoom)):
File "./getmaps", line 75, in tileExists
% (zoom, x, y))
sqlite3.DatabaseError: file is encrypted or is not a database
I'm positive I'm using an sqlite file though..Ubuntu shows it as "GDBM database (application/x-gdbm)".

Lord Raiden 2009-06-11 04:28

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
If it's an older database, or was built with the previous version, then it's likely GDBM. I'd probably ask someone to include GDBM support in their script, but after the hell I went through trying to work with GDBM, I'm not gonna put anyone else through that. >.<

YoDude 2009-06-11 09:31

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
This may be because "Double Pixels" was checked when the maps were downloaded.

An easy way to check this is to:
1. Determine what zoom level you are currently on.
2. Go to "Maps" > "Manage Maps" and select the "Zoom" tab.
3. Whatever Zoom level is checked automatically, should be the level that you manually download for your database.

That is, if you are used to a Double Pixel view and you set up your Zoom Steps to skip every other level you may think you need to download levels 2, 4, 6, 8, 10, and 12 manually.

Because Pixels are doubled, you really need to manually download levels 3, 5, 7, 9, 11, and 13.

Lord Raiden 2009-06-11 18:07

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Ok, I've been playing with this some and if you use the google URL, it works fine, but I prefer Virtual Earth maps, and yet when I put that URL in, it doesn't work. It's likely because of the formatting on the URL. Here's the Virtual Earth Street URL.

http://r0.ortho.tiles.virtualearth.n.../r%0s.png?g=45

Is there any way to get that to work with this script? Do I need to change the formatting of the URL or do I need to hack the script some?

EDIT: Nevermind. I just checked the Google maps, and evidently this version 2.95 they're pushing just utterly blows away the old VEstreets maps! Geez, what a switch! I guess I'll go back to Google Maps for now and skip VEstreets for a while. lol. Man, what a difference 9 months makes! :o

grog 2009-06-11 19:29

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Quote:

Originally Posted by YoDude (Post 295582)
This may be because "Double Pixels" was checked when the maps were downloaded.

I assume you're replying to my post about the perceived size. I don't see a 'Double Pixels' option. Or are you saying that only the odd (or even) levels are being downloaded & that when I zoom in & out MM is interpreting them as sequential levels (i.e. if I downloaded 2,4,6,8 then MM is treating them as 2,3,4,5)? I don't think I'm understanding properly 'cause that doesn't make any sense to me. Is that really what's happening? TX

Lord Raiden 2009-06-11 19:35

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Here's an idea for a much needed improvement. Multiple threads. Given the size of the files, I can easily do up to 20 download threads at the same time, so if there's a way to do more than one download thread at a time, that'd really speed up the work and get the db compilations done much quicker. Right now it's all sequential and that's making things slow. As I said, if it could be done in parallel, with up to 20 threads, that'd make downloading several gigs worth of maps a much quicker proposition.

And I know there's an easy way to do threading in Python. I just don't know offhand what it is, but I've seen other apps that use it.

Lord Raiden 2009-06-16 03:58

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Hey, I've been studying that script and I know how to make it do threading without actually doing threading. :) It's called building children. Here's how it works in principle. You start the program by doing the single line command like this:

./getmaps GStreet.db -children=20 -t 53.00000 -l -98.00000 -b 34.00000 -r -71.00000 -z 16 -z 14 -z 12 -z 10 -z 6 -z 8 -z 6

The -children=20 tells the script to do the build using 20 child processes. Leave that out, and the script goes into normal single process mode. But if you loaded it with the children option, it would in turn spawn child versions of the script where it calls a command line option to spawn another instance of itself instead of handling all the work itself. Thus the spawning command would be something like this:

./getmaps GStreet.db -child -range=1000-1500 -t 53.00000 -l -98.00000 -b 34.00000 -r -71.00000 -z 16 -z 14 -z 12 -z 10 -z 6 -z 8 -z 6

The -child option would tell the script that this is a child and to act accordingly. -range=xxx-xxx would tell it to only process map tiles 1000 through 1500 and then die. The script would then go to sleep after spawning all the processes and then wake up every so many seconds to see who was still alive. If any have exited, it spawns another process to replace it until all maps have been downloaded and the map file is built.

That way the script could process as many as 20x's as many maps and on high speed connections with fast machines you could do as many as 100 child processes, thus allowing you to build a database in record time. :D

That's just an idea for you to chew on. The choice is up to you. :)

Lord Raiden 2009-06-23 10:42

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Hey, been playing with this a bit more and came upon another idea worth considering to add to this script. I've noticed that if it goes along and has a hickup with the network, the script crashes. Why not add in a sleep mode that will pause the script for a specific period of time and then retry again later if it encounters a problem downloading a map file.

I'm not sure how you do error traps in Python, but it would keep me from having to restart the script ever couple of hours when my network or isp hickups.

Lord Raiden 2009-06-27 23:50

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Houston, we have a problem. I just ran the script to download a whole bucket full of maps, and Maemo Mapper is saying it can't read the database. :(

EDIT: Ok, I took the default sqlite db that was built in MM and its saying it's not an sqlite db. What gives?

ayyak 2009-09-18 13:37

Re: Downloading Maemo Mapper maps on PC, is it possible?
 
Help

I don't Know how to do this
pls help me


All times are GMT. The time now is 19:05.

vBulletin® Version 3.8.8