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 

Tools to Convert single tiles to Multiple Tiles per File
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next
 
Post new topic   Reply to topic   printer-friendly view    MGMaps Forum Index -> Stored Maps
View previous topic :: View next topic  
Author Message
Pyrpolizer
Power User


Joined: 09 Nov 2008
Posts: 34

Phone Type: Nokia N95 8GB

PostPosted: Mon Dec 29, 2008 11:37 am    Post subject: Reply with quote

Ambra,

I have done some preliminary work on the Coulmn_Row renaming, here it is, maybe it will save you some time. I am not sure how correct it is so please check everything.
Most propably you will need something similar if you are going to extract files from MTPFs too.

Example:
Rename 150_100.jpg in folder ABCD_8 to (0123 type).jpg or to (QRTS type).jpg
Zoom is determined by the folder in which the file is. Here we have:

Zoom=8
YY=150
XX=100

Zoom-1=7,
2^ 7=128

If YY>128 and XX> 128 then character= 3…S : YY=YY-128 :XX=XX-128
If YY>128 and XX< 128 then character= 1…..R :YY=YY-128
If YY<128 and XX< 128 then character=0….Q
If YY<128 and XX> 128 then character=2 …T : XX=XX-128

Note:check what happens if we have values "=128" and change the if statements accordingly.
Loop until 2^0 and then combine all characters (left to right) together

In the end we should have a file "rttrqsrq.jpg", or "12210310.jpg"
Back to top
View user's profile Send private message
ambra
Power User


Joined: 03 Feb 2008
Posts: 92

Phone Type: SE K810i

PostPosted: Mon Dec 29, 2008 1:48 pm    Post subject: Reply with quote

I don't think I'll have to convert xx_yy to 0123 or qrts, because all I need is absolute coordinates in given zoom level. That, I have in file name already. For files named 0123 or qrts I calculate coordinates.

Anyway, the idea is to check if there's cache.conf file in given folder, and if there is, to collect tiles. Every tile is uniquely represented by zoom level, x and y, and every tile is assigned a file (in the file system), starting offset within a file, and length.
So, for 0123 and qrts files, as well as mgm files with 1 tile per file, offset is 0, and length is total file size. For MPTF files, I'll have to calculate offset and length.

I think I'll have something usable tonight.

BTW, algorithm for converting x_y to "quadkey" is explained here: http://msdn.microsoft.com/en-us/library/bb259689.aspx
Back to top
View user's profile Send private message
Cristian Streng
Founder


Joined: 28 Oct 2005
Posts: 4585

Phone Type: (many)

PostPosted: Mon Dec 29, 2008 2:43 pm    Post subject: Reply with quote

ambra wrote:
BTW, algorithm for converting x_y to "quadkey" is explained here: http://msdn.microsoft.com/en-us/library/bb259689.aspx

You can also find it in the source code for MGMaps/gMapMaker/perl scripts, here's a nice form that works: Wink
Code:
char[] ch = "qrts".getChars();
String s = "";
for (int i=zoom-1; i>=0; i--)
  s += ch[(((y >> i) & 1) << 1) + ((x >> i) & 1)];
Back to top
View user's profile Send private message Visit poster's website
ambra
Power User


Joined: 03 Feb 2008
Posts: 92

Phone Type: SE K810i

PostPosted: Tue Dec 30, 2008 7:59 pm    Post subject: Reply with quote

Cristian Streng wrote:
ambra wrote:
BTW, algorithm for converting x_y to "quadkey" is explained here: http://msdn.microsoft.com/en-us/library/bb259689.aspx

You can also find it in the source code for MGMaps/gMapMaker/perl scripts, here's a nice form that works: Wink
Code:
char[] ch = "qrts".getChars();
String s = "";
for (int i=zoom-1; i>=0; i--)
  s += ch[(((y >> i) & 1) << 1) + ((x >> i) & 1)];


One-liner... great! Wink

Anyway, I updated MapAlive. Now, it can parse MGMapsCache folder for tiles, and save them with different number of tiles per file.

Now, I'll start to make some GUI.
Back to top
View user's profile Send private message
ambra
Power User


Joined: 03 Feb 2008
Posts: 92

Phone Type: SE K810i

PostPosted: Fri Jan 02, 2009 8:35 pm    Post subject: Reply with quote

Simple GUI added.
Soon, I'll add option for saving tiles to KMZ.
Check this post for update informations.
Back to top
View user's profile Send private message
rsanabria80
Power User


Joined: 09 Jan 2009
Posts: 34

Phone Type: Blackberry Curve 8310

PostPosted: Tue Jan 13, 2009 5:37 am    Post subject: Re: Another tool to convert MapCruncher tiles to MGMaps form Reply with quote

ambra wrote:
Finally, I managed to find some time to write Java program for converting MapCruncher tiles to MGMaps format. Actually, that included learning Java, so this is my "Hello World!" application.

Use it like this:
java -jar MapAlive.jar

FEATURES:
- Reads Microsoft MapCruncher tiles
- Reads tiles from MGMaps cache folder (only "hash_size=1")
- Saves tiles to MGMaps cache folder
- Saves tiles as Google Earth KMZ file

More to come.

Please, test MapAlive and give suggestions.


Hello! I'm new here, I really congratulate you guys for all you have done... ! I know it is not a easy thing!

Anyway, I have a Blackberry 8310m I use MGMAPS for flying purposes, and I the maps I use the most are the Google Terrain Maps. I have downloaded all maps I need with the gMapMaker Application, but I have problems due to the amount of files I get. I tried once Hash Size: 1 and Number of Tiles per file 256 and the maps where all messed up... At the end I think I just got one right.

So I din't have no choice other than putting 1 tile per file... The problem with this is that too many files, it takes about 6 hours to copy them from my computer to the handset so it is almost useless although later on it works perfectly... The problem with that too y the space, since so many files use much more space than if it was just one big file, o less bigger files...

I tried MapAlive, and MTPF converter (published in this threat) and MapAlive which has an UI doesn't work for me, it won't find the .mgm files even though I search for the in the right location... I am probably doing something wrong but don't know what!

I tried the Word, and Excel Macros MTPF with no success since I have Office 2007 and I can't get to put the buttons on the macro toolbar (can't find them in the command tab).

As you can see I am not very good on programming so I would gratefully appreciate any help you can provide me in order to have less files with an accurate map result... and an easy way to reduce the amount of tiles...

Please let me know if anyone has a clue!

Thank you very much!
Back to top
View user's profile Send private message
ambra
Power User


Joined: 03 Feb 2008
Posts: 92

Phone Type: SE K810i

PostPosted: Thu Jan 15, 2009 7:12 pm    Post subject: Reply with quote

Can you please upload some of mgm files that MapAlive doesn't recognize?

You must point MapAlive to folder where cache.conf is, not the folder where mgm files are.
Back to top
View user's profile Send private message
rsanabria80
Power User


Joined: 09 Jan 2009
Posts: 34

Phone Type: Blackberry Curve 8310

PostPosted: Fri Jan 16, 2009 12:35 am    Post subject: Reply with quote

ambra wrote:
Can you please upload some of mgm files that MapAlive doesn't recognize?

You must point MapAlive to folder where cache.conf is, not the folder where mgm files are.


Hello Ambra! Thanks for your reply... I was actually looking for the folder where the .mgm files were... Sorry for that...

Now that I finally had MapAlive find the files, i have another problem which is that I don't get mgmaps on my BB to show the maps...

The procedure I do is:
-Open MapAlive.jap
-Select the folder where the Cache.conf is.
-MapAlive does its work and creates a new MGMapsCache folder
-Copy that new folder to the BlackBerry Memory device...

Is that the way it is? Do you recommend any specific amount of tiles per file? Do they all work? I used 256 tiles per file...

Thank you and sorry for bothering!
Back to top
View user's profile Send private message
ambra
Power User


Joined: 03 Feb 2008
Posts: 92

Phone Type: SE K810i

PostPosted: Fri Jan 16, 2009 11:16 am    Post subject: Reply with quote

You must setup MGMaps properly, so it can find the maps.

When saving tiles to MGM format with MapAlive you were asked to name the maps. What did you enter? That name is the name of subfolders in MGMapsCache directory.

Either:
- rename those subfolders to GoogleTer_#, where # is a number that represents the zoom level, and setup MGMaps to use Google Terrain maps, or
- add custom map with the name equal to folder names.
Back to top
View user's profile Send private message
rsanabria80
Power User


Joined: 09 Jan 2009
Posts: 34

Phone Type: Blackberry Curve 8310

PostPosted: Fri Jan 16, 2009 3:14 pm    Post subject: Reply with quote

ambra wrote:
You must setup MGMaps properly, so it can find the maps.

When saving tiles to MGM format with MapAlive you were asked to name the maps. What did you enter? That name is the name of subfolders in MGMapsCache directory.

Either:
- rename those subfolders to GoogleTer_#, where # is a number that represents the zoom level, and setup MGMaps to use Google Terrain maps, or
- add custom map with the name equal to folder names.


Hello Again!

I have done the renaming to GoogleTer_8 (the example of zoom Cool and nothing shows on the mGmaps application, although I go to the right are in the right zoom with Google Terrain activated...

Here I upload the file and it should be on Zoom 8 for the area of Venezuela (South America) N 10 00 00 W 65 00 00

Please let me know if you have any success!

Cheers



MapAlive.rar
 Description:
This Contains the maps Zoom 8 Google Terrain for the Area of Venezuela After MapAlive (North of South America)

Download
 Filename:  MapAlive.rar
 Filesize:  1.73 MB
 Downloaded:  1384 Time(s)


Original.rar
 Description:
This contains the maps Zoom 8 Google Terrain for the Area of Venezuela Before MapAlive

Download
 Filename:  Original.rar
 Filesize:  1.79 MB
 Downloaded:  1411 Time(s)

Back to top
View user's profile Send private message
ambra
Power User


Joined: 03 Feb 2008
Posts: 92

Phone Type: SE K810i

PostPosted: Fri Jan 16, 2009 6:24 pm    Post subject: Reply with quote

It works fine on my phone. There must be something you're not doing right.
Make sure that you upload whole MGMapsCache folder. Then, set up MGMaps. Go to Settings, Map, Stored maps. Check "Stored maps". Then, select Browse and select MGMapsCache folder. Save settings. Then, go to Settings, Map, Map types, and check Google Terrain. Save settings, restart MGMaps, and after that it should display maps. If you're not yet familiar with MGMaps, browse this forum, especially topic named "Stored maps".
Back to top
View user's profile Send private message
rsanabria80
Power User


Joined: 09 Jan 2009
Posts: 34

Phone Type: Blackberry Curve 8310

PostPosted: Sat Jan 17, 2009 2:25 am    Post subject: Reply with quote

ambra wrote:
It works fine on my phone. There must be something you're not doing right.
Make sure that you upload whole MGMapsCache folder. Then, set up MGMaps. Go to Settings, Map, Stored maps. Check "Stored maps". Then, select Browse and select MGMapsCache folder. Save settings. Then, go to Settings, Map, Map types, and check Google Terrain. Save settings, restart MGMaps, and after that it should display maps. If you're not yet familiar with MGMaps, browse this forum, especially topic named "Stored maps".


Hey Ambra, thanks you for your patience... All the settings on my mGmaps are good since I can see the map perfectly if I use the Original (of those I posted in my last post) the problem comes when I try to read the MapAlive conversion. I seem to get some random maps just as If I set GmapMaker to put 256 tiles per file, when I load that one to my device...

Did you try the MapAlive one? or the Original?

If you didn't try the MapAlive one please try it so that I can see whether it is actually a problem on my mGmaps or something wrong that I am still doing... I really believe your tool is very useful if I get it to work...

I have a Blackberry 8310 just in case that makes a difference and I am running the Mobile Gmaps 1.4 version built date July 30, 2008

Thank a lot!
Back to top
View user's profile Send private message
rsanabria80
Power User


Joined: 09 Jan 2009
Posts: 34

Phone Type: Blackberry Curve 8310

PostPosted: Sat Jan 17, 2009 4:15 am    Post subject: Random Maps match when 256 tiles per file is used! Reply with quote

ambra wrote:
It works fine on my phone. There must be something you're not doing right.
Make sure that you upload whole MGMapsCache folder. Then, set up MGMaps. Go to Settings, Map, Stored maps. Check "Stored maps". Then, select Browse and select MGMapsCache folder. Save settings. Then, go to Settings, Map, Map types, and check Google Terrain. Save settings, restart MGMaps, and after that it should display maps. If you're not yet familiar with MGMaps, browse this forum, especially topic named "Stored maps".


Hey Ambra, how are you doing?

Now I write you again because I have realized that using 256 tiles per file, creates exactly the same maps for every type of map, and using no matter which program: gmapmaker or MapAlive...

What I mean with this is that If I create the maps using the GmapMaker from the very beginning with the 256 Tiles per File, it will create the same split and random maps as if I created the map with GmapMaker 1 tile per file and then converted with MapAlive.

For any type of map the random maps will be the same with the 256 tiles per file settings...

As a result I believe there should be some sort of problem when joining the tiles into 1 file... It seems to be an script problem since otherwise the maps wouldn't be the exact same maps for the same setting...

I don't know if it is just my mobile the one with such a problem... But it is very frustrating since if I use the setting that works good (1 tile per file) then I get too many files and copying them to the device is extremely slow...

If anyone is having the same problem or may know how to solve it then please post it! THANK YOU ALL for your help
Back to top
View user's profile Send private message
ambra
Power User


Joined: 03 Feb 2008
Posts: 92

Phone Type: SE K810i

PostPosted: Sat Jan 17, 2009 7:24 am    Post subject: Reply with quote

I've been using MapAlive.rar.

Are you sure you upload the whole MGMapsCache folder, including cache.conf? It is very important to upload cache.conf, because it tells the program how many tiles in the file are.

Also, when using MapAlive to search for tiles, there should be only one map type in MGMapsCache folder.
Back to top
View user's profile Send private message
rsanabria80
Power User


Joined: 09 Jan 2009
Posts: 34

Phone Type: Blackberry Curve 8310

PostPosted: Sat Jan 17, 2009 7:33 am    Post subject: Reply with quote

ambra wrote:
I've been using MapAlive.rar.

Are you sure you upload the whole MGMapsCache folder, including cache.conf? It is very important to upload cache.conf, because it tells the program how many tiles in the file are.

Also, when using MapAlive to search for tiles, there should be only one map type in MGMapsCache folder.


Yes I,m sure I am doing everything you have described correctly! Have you compared the original with the mapalive one to see if they are both exactly displayed in your mobile?

Its very wierd because I do get some maps displayed but those are not the correct one!
Back to top
View user's profile Send private message
Urb
Junior


Joined: 12 Jan 2009
Posts: 5

Phone Type: Unknown

PostPosted: Sat Jan 17, 2009 10:32 am    Post subject: What advantage in transforming 123....png tiles to .mgm form Reply with quote

I am quite new to Mobile Gmap, but I find this application very interesting and I've already used it while trekking. Phone is Sony C702, maps are digitalized from French GeoPortail, down to 1/25000.

Up to now I am using 123...png tiles
I wonder what would be a good reason to transform them as .mgm files ?

So, here is my workflow :
_Digitalize small maps and assemble them in one large xxx.jpg
(2 to 3 MB)
_Use of MapCruncher, to generate a set of 123...png files
which occupy around 100 MB of memory space
_ Transform all 123...png to 123...jpg files, then rename them 123...png
Memory space is now as low as 5 MB (typcal)
_Up to now I just transfer that in the phone memory, and use it.

Reading this forum, I find that a lot of discussion arise about transforming the 123...png tiles in .mgm format. So I try it and succeed in the process BUT the memory needed is now up to 9 / 10 MB, twice as formerly.
When using the phone, there is no visible difference.

Does somebody can lighten me about the interest of this transformation.
Thanks by advance.
Back to top
View user's profile Send private message
ambra
Power User


Joined: 03 Feb 2008
Posts: 92

Phone Type: SE K810i

PostPosted: Sat Jan 17, 2009 7:27 pm    Post subject: Reply with quote

rsanabria80 wrote:
Have you compared the original with the mapalive one to see if they are both exactly displayed in your mobile?

Yes. My phone displays them both correctly. I really can't figure out what the problem is...
Back to top
View user's profile Send private message
ambra
Power User


Joined: 03 Feb 2008
Posts: 92

Phone Type: SE K810i

PostPosted: Sat Jan 17, 2009 7:36 pm    Post subject: Re: What advantage in transforming 123....png tiles to .mgm Reply with quote

Urb wrote:
_Digitalize small maps and assemble them in one large xxx.jpg

OK! But, it may not be necessary to assemble multiple images. Microsoft MapCruncher can do that for you. Just add all images to the same layer and, position them all.
Urb wrote:
_Use of MapCruncher, to generate a set of 123...png files which occupy around 100 MB of memory space

OK!
Urb wrote:
_ Transform all 123...png to 123...jpg files

OK!
Urb wrote:
then rename them 123...png

Not necessary! You can skip renaming.
Urb wrote:
_Up to now I just transfer that in the phone memory, and use it.


Not just yet!
Transform the tiles to MGMaps format. You can use MapAlive for that task. Save the tiles to MGMaps format with multiple tiles per file. That way, the tiles won't occupy more space then normal. You might have to experiment to see how many tiles per file to use. It depends on your phone. Try 64, or more. After that, upload the tiles to your phone, and setup MGMaps.
Back to top
View user's profile Send private message
Urb
Junior


Joined: 12 Jan 2009
Posts: 5

Phone Type: Unknown

PostPosted: Sun Jan 18, 2009 8:43 am    Post subject: Reply with quote

First : thank for your answer

Quote:
Ambra wrote :
Transform the tiles to MGMaps format. You can use MapAlive for that task. Save the tiles to MGMaps format with multiple tiles per file. That way, the tiles won't occupy more space then normal. You might have to experiment to see how many tiles per file to use. It depends on your phone. Try 64, or more. After that, upload the tiles to your phone, and setup MGMaps.


That is what I did.
I used MapAlive with 256 tiles per file, and the result was doubling the memory occupancy. I will try other settings later today, and let you know the result.
Back to top
View user's profile Send private message
ambra
Power User


Joined: 03 Feb 2008
Posts: 92

Phone Type: SE K810i

PostPosted: Sun Jan 18, 2009 9:19 am    Post subject: Reply with quote

Urb wrote:
I used MapAlive with 256 tiles per file, and the result was doubling the memory occupancy. I will try other settings later today, and let you know the result.


Right click on MGMapsCache folder and select Properties. There should be "Size: xxx MB" and "Size on the disk: xxx MB". Do it after saving tiles with 1 tile per file, 256 tiles per file, and original folder with "0123....png" tiles.
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
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Page 2 of 9

 
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