Mobile GMaps Home Page
 FAQFAQ    SearchSearch    MemberlistMemberlist    UsergroupsUsergroups   RegisterRegister  
 ProfileProfile    Log in to check your private messagesLog in to check your private messages    Log inLog in 

New interactive GUI for tile downloading

 
Post new topic   Reply to topic   printer-friendly view    MGMaps Forum Index -> Stored Maps
View previous topic :: View next topic  
Author Message
valentin
Junior


Joined: 09 Feb 2010
Posts: 8
Location: Riga, Latvia
Phone Type: ASUS A696

PostPosted: Tue Feb 09, 2010 4:31 pm    Post subject: New interactive GUI for tile downloading Reply with quote

Hello everyone!
Last couple of weeks I was working on my first GUI project in Ruby, which is a GUI for interactive map tile downloading and exporting in mgmaps format. I am glad to announce that the program's first version (0.1.1) is released. More info on http://wiki.github.com/vbichkovsky/mapcache/
Looking forward for your comments.


Last edited by valentin on Fri Feb 12, 2010 10:28 pm; edited 1 time in total
Back to top
View user's profile Send private message
DavidOttawa
Power User


Joined: 28 Dec 2007
Posts: 32
Location: Ottawa, Canada
Phone Type: Blackberry 8310, 9700

PostPosted: Fri Feb 12, 2010 3:00 am    Post subject: Reply with quote

Very nice. And this is your first GUI app in Ruby?

For others who download the program who are not familiar with Ruby, here are some additional details.

(1) Install Ruby as shown.
(2) Expand the ZIP file into some directory.
(3) Open a DOS command window. Move to a directory where you want map tiles collected.
(4) Type "gem install mapcache". It doesn't seem to care where the mapcache files were copied. You only do this step once.
(4) After GEM has finished installing, type "mapcache". This should open the GUI window showing the greater Riga area.

As you pan and zoom using the mouse, mapcache copies the map tiles into a subdirectory of the current directory, /maps. The files are grouped by zoom level.

You can export all the map tiles that you have collected from the maps folder to the parallel export folder (both created by mapcache) by typing "e". It seems to offer both hash level and tiles-per-file.

You can display which map tiles are present in the maps directory by toggling with the "m" key. This is called "coverage". The map tiles that are present at the zoom level shown by "coverage" in the status bar are shaded in green. You can change the coverage zoom level by pressing [ or ] keys.

In my initial opinion, this is a difficult way to select tiles for downloading. You have to pan all over at each zoom level to download the tiles.

On the other hand, it is a brilliant way to display the tiles that have been downloaded. It would be nice if you could specify a directory to use, besides the /maps one created. For example, I keep map tiles in folders by city, e.g. Paris_zoom15. It would be nice if I could display the coverage of the tiles in that directory. You might want a read-only mode, too, where it doesn't save the tiles while checking the coverage.

Congratulations on a nice piece of code.
Back to top
View user's profile Send private message
valentin
Junior


Joined: 09 Feb 2010
Posts: 8
Location: Riga, Latvia
Phone Type: ASUS A696

PostPosted: Fri Feb 12, 2010 12:40 pm    Post subject: Reply with quote

Thanks for the reply and provided installation details!
Yes, this is my first GUI app in Ruby, but not the first GUI app and not the first Ruby app Smile

Actually, you don't need this step

Quote:
(2) Expand the ZIP file into some directory.


Rubygems automatically downloads mapcache from gemcutter.org and installs it. When the next version will be available, just type

Code:
gem update mapcache


It works like, say, apt packaging system for Debian.

Quote:
In my initial opinion, this is a difficult way to select tiles for downloading. You have to pan all over at each zoom level to download the tiles.


Well, this mode is more for viewing the map and going to some location for further downloading (which is not implemented yet). I am going to implement selection in the next version, so you could pan and zoom to some location, then paint-select with cursor some area and download tiles for that area for given zoom levels.

Quote:
On the other hand, it is a brilliant way to display the tiles that have been downloaded. It would be nice if you could specify a directory to use, besides the /maps one created. For example, I keep map tiles in folders by city, e.g. Paris_zoom15. It would be nice if I could display the coverage of the tiles in that directory. You might want a read-only mode, too, where it doesn't save the tiles while checking the coverage.


Thanks, this is importand feedback. I don't have my big collection of map tiles yet, so I'm storing everything in a single folder. But I am aware of performance issues, when the number of tiles will grow. My idea is to store everything in one place, separated by map types and zoom levels (1 tile per file, no hashing in mgmaps terminology). But when you need to transfer some area to the mobile device, you have select it and export it (providing "tiles per file" and "hashing" values).
Why do you keep maps in separate folders? Is it because each folder contains "pre-selected tiles" only, so that you can copy exactly what you want on the mobile device? If there could be the option to select some area (Paris) for some zoom level(s) (15) and export, would you store all the maps in a single folder? Selection could be saved with some name (Paris_15) and used when you need it again.
It would be great to know from other mgmaps users, how do they store and organize their map tiles on the disk.
Back to top
View user's profile Send private message
DavidOttawa
Power User


Joined: 28 Dec 2007
Posts: 32
Location: Ottawa, Canada
Phone Type: Blackberry 8310, 9700

PostPosted: Sat Feb 13, 2010 1:15 am    Post subject: Reply with quote

That explains why GEM did not ask where the ZIP file contents were. That's pretty cool.

My approach to storing offline maps on the PC is described in http://www.mgmaps.com/stored/. I have more maps on my PC than fit into the phone memory. They are organized into folders like Paris_zoom15. So I pick the ones I need for a particular trip, delete all the maps on the phone, and copy the new ones to the phone. It is a bit involved, but I just let the BAT file copy the files while I do something else.

You are suggesting that mapcache could do the work. All map tiles would be stored in /maps. I could choose an area and call it Paris_15. Then I could ask mapcache to export Paris_15 and say London_17. The advantage of this approach over mine is that mapcache can use tiles_per_file>1, thereby speeding up the transfer process. If you could choose the location for the export operation, you could even transfer directly the phone, saving about half the time.

Here is another scenario. I define .map files using mapcacher. I then run gMapMaker to download the tiles for the area defined by the .map file. Next year I can run gMapMaker again with the same .map file and get the latest maps. Could you also save named rectangular regions like this? Then ask to download all the tiles in that region?

There are probably other people with other ways that they use mgmaps. My approach works for me, but I am always looking for better ways to do it.
Back to top
View user's profile Send private message
Cristian Streng
Founder


Joined: 28 Oct 2005
Posts: 4585

Phone Type: (many)

PostPosted: Thu Feb 25, 2010 7:06 am    Post subject: Reply with quote

Hi,

I just tried to install the application on my Linux VM... gem install mapcache worked fine, but then how do I run it? There's no mapcache executable in the path, I searched for mapcache and found it under /var/lib/gems/1.8/bin, but when I try to run it I get an error. Do I need to add some path settings? Maybe download some other gems? I'm using ruby 1.8.7 on Ubuntu 9.10.

I'll try it on Windows too, but we have gMapMaker as an alternative there. Linux, maybe Mac support would be more useful Smile
Code:
root@ubuntu:/var/lib/gems/1.8/bin# ./mapcache
/var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so: /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so: symbol _ZN13wxAuiNotebook14ShowWindowMenuEv, version WXU_2.8.5 not defined in file libwx_gtk2u_aui-2.8.so.0 with link time reference - /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so (LoadError)
   from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
   from /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wx.rb:12
   from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
   from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
   from /var/lib/gems/1.8/gems/mapcache-0.1.1/bin/mapcache:2
   from ./mapcache:19:in `load'
   from ./mapcache:19
Back to top
View user's profile Send private message Visit poster's website
Cristian Streng
Founder


Joined: 28 Oct 2005
Posts: 4585

Phone Type: (many)

PostPosted: Thu Feb 25, 2010 7:17 am    Post subject: Reply with quote

UPDATE: just tried it in the Mac VM.
Code:
Mac-Admins-Mac:~ root# ruby --version
ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
Mac-Admins-Mac:~ root# gem install mapcache
ERROR:  Error installing mapcache:
   mapcache requires wxruby (>= 2.0.1, runtime)
Mac-Admins-Mac:~ root# gem install wxruby
Successfully installed wxruby-1.9.3-universal-darwin
1 gem installed
Mac-Admins-Mac:~ root# gem install mapcache
ERROR:  Error installing mapcache:
   mapcache requires wxruby (>= 2.0.1, runtime)

So I need a newer wxruby? What's the easiest way to install that?
Back to top
View user's profile Send private message Visit poster's website
valentin
Junior


Joined: 09 Feb 2010
Posts: 8
Location: Riga, Latvia
Phone Type: ASUS A696

PostPosted: Thu Feb 25, 2010 11:42 am    Post subject: Reply with quote

Hi!

Cristian Streng wrote:
... gem install mapcache worked fine, but then how do I run it? There's no mapcache executable in the path...

Try
Code:
sudo gem install mapcache

it will be installed in other location and will be available in the default path.
Btw, check your rubygems version with
Code:
gem -v

it should be 1.3.x.
I googled for this error
Code:
symbol _ZN13wxAuiNotebook14ShowWindowMenuEv, version WXU_2.8.5 not defined in file libwx_gtk2u_aui-2.8.so.0 with link time reference

and found this link http://www.ruby-forum.com/topic/195115. Looks like something is wrong with libraries. There is a recipe how to build wxRuby on Ubuntu 9.10 manually, but it looks way complicated for me http://wxruby.rubyforge.org/wiki/wiki.pl?BuildingOnTopOfLinuxDistroPackages.

Seems like I am the only person, who managed to run mapcache on Ubuntu 9.10 Confused (I developed it under Ubuntu and then tested under Windows). Maybe that's because I tried several GUI toolkits (Ruby-GNOME2, FX-Ruby) before wxRuby and installed required library versions.
I hope I'll have access to another Ubuntu box on weekend, so I'll try to find out, what's the problem.
As for Mac, I didn't test my app there (don't have access and it wasn't my goal to run it on Mac). But, as Ruby works there and wxRuby spec also tells that it works there, you may try Smile
From the output from your Mac VM it looks like the gem command installs gems without dependencies by default. Maybe it is some old version, try
Code:
gem update --system


You can also force it to install all dependencies with
Code:
gem install -y mapcache


Good luck Smile
Back to top
View user's profile Send private message
Cristian Streng
Founder


Joined: 28 Oct 2005
Posts: 4585

Phone Type: (many)

PostPosted: Thu Feb 25, 2010 12:40 pm    Post subject: Reply with quote

valentin wrote:
Try
Code:
sudo gem install mapcache

it will be installed in other location and will be available in the default path.

If you look again you'll see I'm root.

valentin wrote:
Btw, check your rubygems version with
Code:
gem -v

it should be 1.3.x.

It's 1.3.5.

valentin wrote:
I googled for this error
Code:
symbol _ZN13wxAuiNotebook14ShowWindowMenuEv, version WXU_2.8.5 not defined in file libwx_gtk2u_aui-2.8.so.0 with link time reference

and found this link http://www.ruby-forum.com/topic/195115.

Thanks, this worked:
Code:
wget http://www.trilake.net/wxRuby/wxruby-2.0.1-x86-linux.gem
sudo gem install --local wxruby-2.0.1-x86-linux.gem
sudo apt-get install libwxgtk2.8-0 libwxbase2.8-0

No idea why you need a custom built package.

valentin wrote:
Looks like something is wrong with libraries. There is a recipe how to build wxRuby on Ubuntu 9.10 manually, but it looks way complicated for me http://wxruby.rubyforge.org/wiki/wiki.pl?BuildingOnTopOfLinuxDistroPackages.

Yeah, I'm looking for something easier to use than the Perl command-line scripts MapTileFE/MapTileCacher, especially for non-tech-savvy users (Mac users especially). Compiling ruby or even libraries from sources is not really a good solution.

valentin wrote:
Seems like I am the only person, who managed to run mapcache on Ubuntu 9.10 Confused (I developed it under Ubuntu and then tested under Windows). Maybe that's because I tried several GUI toolkits (Ruby-GNOME2, FX-Ruby) before wxRuby and installed required library versions.
I hope I'll have access to another Ubuntu box on weekend, so I'll try to find out, what's the problem.

Did you have all the libraries installed from the default source / apt repository?

valentin wrote:
As for Mac, I didn't test my app there (don't have access and it wasn't my goal to run it on Mac). But, as Ruby works there and wxRuby spec also tells that it works there, you may try Smile

I'll try! Any links to a quick/easy installation of wxRuby on Mac? It seems ruby is already built in, or maybe it got installed with some xCode/iPhone dev kit, it comes with an older wxRuby though.

valentin wrote:
From the output from your Mac VM it looks like the gem command installs gems without dependencies by default. Maybe it is some old version, try
Code:
gem update --system


You can also force it to install all dependencies with
Code:
gem install -y mapcache


Good luck Smile

Didn't work, same error message. I found this: http://www.ruby-forum.com/topic/195670, see last post... I downloaded wxruby 2.0.1 manually from http://rubygems.org/downloads/wxruby-2.0.1-universal-darwin-9.gem and installed it with gem install --local. Still it doesn't work, it gives "no matching architecture in universal wrapper". Any suggestions?
Back to top
View user's profile Send private message Visit poster's website
valentin
Junior


Joined: 09 Feb 2010
Posts: 8
Location: Riga, Latvia
Phone Type: ASUS A696

PostPosted: Thu Feb 25, 2010 5:49 pm    Post subject: Reply with quote

Quote:
Thanks, this worked:
Code:
wget http://www.trilake.net/wxRuby/wxruby-2.0.1-x86-linux.gem
sudo gem install --local wxruby-2.0.1-x86-linux.gem
sudo apt-get install libwxgtk2.8-0 libwxbase2.8-0

So, does the app work after installing this gem?
Btw, last message from that thread says:
Quote:
Sorry, seems that the gem is messed up, please don't download from that URL till I say it is alright.


Quote:
No idea why you need a custom built package.

It's not just me, it looks like default wxRuby gem (from the remote repository) doesn't work on Ubuntu 9.10. So any other wxRuby app won't work either.

Quote:
Did you have all the libraries installed from the default source / apt repository?

Yes, I didn't use the custom wxRuby gem mentioned above. Somehow it worked for me without errors.

Quote:
Didn't work, same error message. I found this: http://www.ruby-forum.com/topic/195670, see last post... I downloaded wxruby 2.0.1 manually from http://rubygems.org/downloads/wxruby-2.0.1-universal-darwin-9.gem and installed it with gem install --local. Still it doesn't work, it gives "no matching architecture in universal wrapper". Any suggestions?

I think, this post http://www.ruby-forum.com/topic/195670#853108 explains why this happens.

Alas, looks like wxRuby isn't so cross-platform yet Sad

Quote:
... gem install mapcache worked fine, but then how do I run it? There's no mapcache executable in the path...

oops.. sorry, I forgot this in the install instruction. You should add /var/lib/gems/1.8/bin to the path. All executable gems (such as rails, rake etc.) will be installed in this directory.
Back to top
View user's profile Send private message
Cristian Streng
Founder


Joined: 28 Oct 2005
Posts: 4585

Phone Type: (many)

PostPosted: Thu Feb 25, 2010 6:01 pm    Post subject: Reply with quote

valentin wrote:
So, does the app work after installing this gem?

Yes, it works. I didn't give you any feedback... Well, it's rather strange how it selects the areas downloaded, I prefer mapcacher/gMapMaker for that, although it's nice to automatically have cached any areas viewed.

I'd prefer a Java application and maybe will create something like that if I have more time to spend into MGMaps this year. At least that will be cross-platform and hopefully easier to use than the ruby thing.
Back to top
View user's profile Send private message Visit poster's website
valentin
Junior


Joined: 09 Feb 2010
Posts: 8
Location: Riga, Latvia
Phone Type: ASUS A696

PostPosted: Thu Feb 25, 2010 6:24 pm    Post subject: Reply with quote

Cristian Streng wrote:
Well, it's rather strange how it selects the areas downloaded

It doesn't select anything (selecting functionality isn't implemented yet), it just allows you to see which areas you already have on your drive for zoom levels [current_zoom+1..current_zoom+8].
Back to top
View user's profile Send private message
Cristian Streng
Founder


Joined: 28 Oct 2005
Posts: 4585

Phone Type: (many)

PostPosted: Fri Feb 26, 2010 8:22 am    Post subject: Reply with quote

valentin wrote:
Cristian Streng wrote:
Well, it's rather strange how it selects the areas downloaded

It doesn't select anything (selecting functionality isn't implemented yet), it just allows you to see which areas you already have on your drive for zoom levels [current_zoom+1..current_zoom+8].

Right, but it also downloads the map tiles for any areas you are viewing.

By the way, I tried it in Windows now, it works but it does not show the map, it shows just a white screen... the map tiles are downloaded correctly though.
Back to top
View user's profile Send private message Visit poster's website
valentin
Junior


Joined: 09 Feb 2010
Posts: 8
Location: Riga, Latvia
Phone Type: ASUS A696

PostPosted: Fri Feb 26, 2010 10:21 am    Post subject: Reply with quote

Cristian Streng wrote:

Right, but it also downloads the map tiles for any areas you are viewing.

That's correct, this is one of the ways you can quickly download some tiles. But this mode is primarily intended for browsing maps.
Quote:

By the way, I tried it in Windows now, it works but it does not show the map, it shows just a white screen... the map tiles are downloaded correctly though.

Hmm.. that's strange. Does pressing the 'm' key change situation? There was a bug with drawing coverage on the map in version 0.1.0 on windows platform (http://www.ruby-forum.com/topic/203584), but I fixed it in version 0.1.1. It works correctly on my Windows box, my friend's box (tested it yesterday) and looks like DavidOttawa also runs it on Windows.

You can check your mapcache version with
Code:
gem list mapcache

If it is 0.1.0, you may upgrade it with
Code:
gem update mapcache
Back to top
View user's profile Send private message
Cristian Streng
Founder


Joined: 28 Oct 2005
Posts: 4585

Phone Type: (many)

PostPosted: Fri Feb 26, 2010 5:38 pm    Post subject: Reply with quote

valentin wrote:
Hmm.. that's strange. Does pressing the 'm' key change situation? There was a bug with drawing coverage on the map in version 0.1.0 on windows platform (http://www.ruby-forum.com/topic/203584), but I fixed it in version 0.1.1. It works correctly on my Windows box, my friend's box (tested it yesterday) and looks like DavidOttawa also runs it on Windows.

You can check your mapcache version with
Code:
gem list mapcache

If it is 0.1.0, you may upgrade it with
Code:
gem update mapcache

Yes, pressing 'm' fixes it, it works when coverage is disabled. Still I have v0.1.1 installed on Windows XP, so that bug you're talking about is still there.
Back to top
View user's profile Send private message Visit poster's website
valentin
Junior


Joined: 09 Feb 2010
Posts: 8
Location: Riga, Latvia
Phone Type: ASUS A696

PostPosted: Fri Feb 26, 2010 7:51 pm    Post subject: Reply with quote

Quote:
Still I have v0.1.1 installed on Windows XP, so that bug you're talking about is still there.

What can I say...
It works correctly on three other Windows machines, and at least two of them are running Windows XP (I don't know which version DavidOttawa uses).
I think, I'll wait for more feedback about running mapcache on Windows XP.
If this bug reappears on some other machine, too, I'll consider migrating my app to the other GUI toolkit - FXRuby.

UPDATE
DC#draw_bitmap patch is loaded by analysing the RUBY_PLATFORM constant (it should match /mswin/). You can check it with
Code:
ruby -e "p RUBY_PLATFORM"
Back to top
View user's profile Send private message
shoosly
Junior


Joined: 24 May 2009
Posts: 3

Phone Type: Unknown

PostPosted: Mon Apr 26, 2010 9:42 am    Post subject: Reply with quote

i cant run ruby anyone help Crying or Very sad
Back to top
View user's profile Send private message
valentin
Junior


Joined: 09 Feb 2010
Posts: 8
Location: Riga, Latvia
Phone Type: ASUS A696

PostPosted: Mon Apr 26, 2010 12:33 pm    Post subject: Reply with quote

Quote:
i cant run ruby anyone help

You need to provide more detail. Tell your story - what did you install to run it, which commands did you type etc.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MGMaps Forum Index -> Stored Maps All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
MGMaps topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group