OruxMaps
Visit the new forum: <a href="http://www.oruxmaps.com/foro">OruxMaps</a>

Join the forum, it's quick and easy

OruxMaps
Visit the new forum: <a href="http://www.oruxmaps.com/foro">OruxMaps</a>
OruxMaps
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Import multiple files, Swiss grid

2 posters

Go down

Import multiple files, Swiss grid Empty Import multiple files, Swiss grid

Post  martin25 Mon Dec 05, 2011 3:58 pm

Hi,

I have several map files for Switzerland I'd like to combine in a single tiled map. I managed to tile a single map file for use in OruxMaps using OruxMapsDesktop, but I have no idea how to combine multiple files (or an existing tile set) so OruxMaps could use it. In the MOBAC readme there is a topic regarding this (Custom atlas as map source / locally generated tiles), but I don't see a way of specifying the Swiss grid there. Any suggestions?

- Martin

martin25

Cantidad de envíos : 18
Fecha de inscripción : 2011-12-05

Back to top Go down

Import multiple files, Swiss grid Empty Re: Import multiple files, Swiss grid

Post  orux Sat Dec 10, 2011 5:01 pm

martin25 wrote:Hi,

I have several map files for Switzerland I'd like to combine in a single tiled map. I managed to tile a single map file for use in OruxMaps using OruxMapsDesktop, but I have no idea how to combine multiple files (or an existing tile set) so OruxMaps could use it. In the MOBAC readme there is a topic regarding this (Custom atlas as map source / locally generated tiles), but I don't see a way of specifying the Swiss grid there. Any suggestions?

- Martin

Hi, Martin;

You can use global mapper (or ozi map merge, if ozi maps) to create a larger map.

But OruxMapsDesktop can not handle very large maps (eg, over 20.000x20.000 pixels).

orux
orux
orux

Cantidad de envíos : 3946
Fecha de inscripción : 2009-07-06

Back to top Go down

Import multiple files, Swiss grid Empty Re: Import multiple files, Swiss grid

Post  martin25 Sat Dec 10, 2011 5:20 pm

Hi Orux,

I have map tiles of 2000x2000 pixels size. Joining all would give a size of about 150000x92000 pixels - won't work.

I thought maybe I could do the conversion myself, if I just have to re-tile the existing tiles and generate an .otrk2.xml file. Would this work:

1. split the tiles in smaller ones (250x250, 500x500, 1000x1000 - what would you recommend?) and save as .jpg. Bigger tiles would be better as small tiles will give A LOT of files.
2. rename them according to your namin convention (eg. tile_5_17.omc2)
3. create a matching .otrk2.xml file

Looking at an existing file:

<?xml version="1.0" encoding="UTF-8"?>
<OruxTracker xmlns="http://oruxtracker.com/app/res/calibration"
versionCode="2.1">
<MapCalibration layers="false" layerLevel="13">
<MapName><![CDATA[200b.gif 13]]></MapName>
<MapChunks xMax="38" yMax="6" datum="CH-1903:Swiss@WGS 1984:Global Definition" projection="(SUI) Swiss Grid," img_height="512" img_width="512" file_name="200b.gif 13" />
<MapDimensions height="2880" width="19200" />
<MapBounds minLat="46.94758749044967" maxLat="47.49753214569313" minLon="5.620338084860527" maxLon="10.715412001381374" />
<CalibrationPoints>
<CalibrationPoint corner="TL" lon="5.620338084860527" lat="47.49753214569313" />
<CalibrationPoint corner="BR" lon="10.683721953936619" lat="46.94758749044967" />
<CalibrationPoint corner="TR" lon="10.715412001381374" lat="47.46506419549722" />
<CalibrationPoint corner="BL" lon="5.6377965977168305" lat="46.97975014586487" />
</CalibrationPoints>
</MapCalibration>
</OruxTracker>

it seems that I could insert the correct lat/lon values (converted from the map swiss coordinates) and insert them for MapBounds and the four calibration points. Would this work?

Thanks, Martin

martin25

Cantidad de envíos : 18
Fecha de inscripción : 2011-12-05

Back to top Go down

Import multiple files, Swiss grid Empty Re: Import multiple files, Swiss grid

Post  orux Sat Dec 10, 2011 5:37 pm

martin25 wrote:Hi Orux,

I have map tiles of 2000x2000 pixels size. Joining all would give a size of about 150000x92000 pixels - won't work.

I thought maybe I could do the conversion myself, if I just have to re-tile the existing tiles and generate an .otrk2.xml file. Would this work:

1. split the tiles in smaller ones (250x250, 500x500, 1000x1000 - what would you recommend?) and save as .jpg. Bigger tiles would be better as small tiles will give A LOT of files.
2. rename them according to your namin convention (eg. tile_5_17.omc2)
3. create a matching .otrk2.xml file

Looking at an existing file:

<?xml version="1.0" encoding="UTF-8"?>
<OruxTracker xmlns="http://oruxtracker.com/app/res/calibration"
versionCode="2.1">
<MapCalibration layers="false" layerLevel="13">
<MapName><![CDATA[200b.gif 13]]></MapName>
<MapChunks xMax="38" yMax="6" datum="CH-1903:Swiss@WGS 1984:Global Definition" projection="(SUI) Swiss Grid," img_height="512" img_width="512" file_name="200b.gif 13" />
<MapDimensions height="2880" width="19200" />
<MapBounds minLat="46.94758749044967" maxLat="47.49753214569313" minLon="5.620338084860527" maxLon="10.715412001381374" />
<CalibrationPoints>
<CalibrationPoint corner="TL" lon="5.620338084860527" lat="47.49753214569313" />
<CalibrationPoint corner="BR" lon="10.683721953936619" lat="46.94758749044967" />
<CalibrationPoint corner="TR" lon="10.715412001381374" lat="47.46506419549722" />
<CalibrationPoint corner="BL" lon="5.6377965977168305" lat="46.97975014586487" />
</CalibrationPoints>
</MapCalibration>
</OruxTracker>

it seems that I could insert the correct lat/lon values (converted from the map swiss coordinates) and insert them for MapBounds and the four calibration points. Would this work?

Thanks, Martin

Hi, Martin;

OruxMaps only works with power of two tile maps (128, 256, 512) tile sizes.

You should link the images, and then cut into tiles of that size.

The file. Otrk2.xml is easy to interpret. You must use the coordinates of the corners using the WGS84 datum.

orux
orux
orux

Cantidad de envíos : 3946
Fecha de inscripción : 2009-07-06

Back to top Go down

Import multiple files, Swiss grid Empty Re: Import multiple files, Swiss grid

Post  martin25 Sat Dec 10, 2011 6:01 pm

orux wrote:
Hi, Martin;

OruxMaps only works with power of two tile maps (128, 256, 512) tile sizes.

You should link the images, and then cut into tiles of that size.
...
Hi Orux,

I almost expected you would say that... well, this will be some work, but no real problem. Thanks!

- Martin

martin25

Cantidad de envíos : 18
Fecha de inscripción : 2011-12-05

Back to top Go down

Import multiple files, Swiss grid Empty missing tiles?

Post  martin25 Sat Dec 10, 2011 6:41 pm

One more thing - do all tiles need to be present in a map?
When I have a non-rectangular outline of the original map, some tiles (eg. of the corners) are missing. Can OruxMaps handle that or do I have to create dummy tiles for the missing map area?

- Martin

martin25

Cantidad de envíos : 18
Fecha de inscripción : 2011-12-05

Back to top Go down

Import multiple files, Swiss grid Empty Re: Import multiple files, Swiss grid

Post  orux Sat Dec 10, 2011 6:42 pm

martin25 wrote:One more thing - do all tiles need to be present in a map?
When I have a non-rectangular outline of the original map, some tiles (eg. of the corners) are missing. Can OruxMaps handle that or do I have to create dummy tiles for the missing map area?

- Martin

Hi,

OruxMaps should handle such situations smoothly.

orux
orux
orux

Cantidad de envíos : 3946
Fecha de inscripción : 2009-07-06

Back to top Go down

Import multiple files, Swiss grid Empty Too many tiles for FAT32!

Post  martin25 Fri Dec 16, 2011 8:07 pm

Hi Orux,

so far, so good. I have converted all tiles to 512x512 and with smaller map sets, display seems to work. However, I can't load all tiles in the /set subdirectory on the SD card! I have about 34000 tiles, but only about 21000 can be put in one directory. After some research, I found out that this is probably related to the FAT32 file system commonly used on SD cards. FAT32 can have 65535 files in one folder, but if the files have a long filename (long means longer than 8.3), things look different. Initially, FAT32 was developed so old DOS programs could also access files with longer file names. A scheme for mapping those is used, "Program Files" gets to "PROGRA~1" and so on. The problem is if there are many files starting with the same characters, this numbering scheme runs out of space. I guess this happened with my map tiles. The names like "25k 16_123_123.omc2" are just too long...

Obviously I don't want to cut the map set in half. Magically, most trips I am doing are near map borders and seeing only half of the map near the borders was by far the most annoying thing when using OziExplorer on my old Windows phone.
So what are the options? Can I add another directory (like "set2", "set3") or similar? Or can I somehow have two directories with map sets (and possibly different calibrations) that are both displayed at the same time? I checked the source code of MOBAC but did not really find a clue there.

BTW you could help things by using shorter 8.3 file names like 1234_123.omc - the map and zoom level information is already in the xml file and directory name and is actually redundant in the file name.

- Martin

martin25

Cantidad de envíos : 18
Fecha de inscripción : 2011-12-05

Back to top Go down

Import multiple files, Swiss grid Empty SQLite map > 2 GB?

Post  martin25 Sun Jan 01, 2012 4:29 pm

After some experimenting I put all my 33000 tiles in a SQLite database. This works partly, but somewhere else you write the maximum size on a FAT32 SD card is 2 GB - but my tiles are 3 GB altogether. So:

Is there a possibility to create a seamless map with 3 GB of tiles (using CH1903 projection)?

I could increase the jpeg compression to fit the 3 GB of tiles into 2 GB, but this does not look to pretty.

Thanks - Martin

martin25

Cantidad de envíos : 18
Fecha de inscripción : 2011-12-05

Back to top Go down

Import multiple files, Swiss grid Empty Re: Import multiple files, Swiss grid

Post  orux Sun Jan 01, 2012 5:35 pm

martin25 wrote:After some experimenting I put all my 33000 tiles in a SQLite database. This works partly, but somewhere else you write the maximum size on a FAT32 SD card is 2 GB - but my tiles are 3 GB altogether. So:

Is there a possibility to create a seamless map with 3 GB of tiles (using CH1903 projection)?

I could increase the jpeg compression to fit the 3 GB of tiles into 2 GB, but this does not look to pretty.

Thanks - Martin

Hi, Martin;

I think fat32 limit per file is 4gb.


The maximum possible size for a file on a FAT32 volume is 4 GB minus 1 byte or 4 294 967 295 (232−1) bytes. This limit is a consequence of the file length entry in the directory table and would also affect huge FAT16 partitions with a sufficient sector size.[1] Video applications, large databases, and some other software easily exceed this limit. Larger files require another filesystem.

orux
orux
orux

Cantidad de envíos : 3946
Fecha de inscripción : 2009-07-06

Back to top Go down

Import multiple files, Swiss grid Empty 3 GB SQLite database?

Post  martin25 Sun Jan 01, 2012 6:39 pm

orux wrote:...
Hi, Martin;

I think fat32 limit per file is 4gb.

orux
Hi Orux,

here https://oruxmaps.forumotion.com/t574-map-size-and-optimum-settings you wrote it would be 2GB. I know that FAT32 can handle 4GB files, but I tried it and it doesn't work...

I have put all tiles in a 3 GB SQLite database. The left part of the map is perfect, calibration OK and everything. However, on the right side of the map, tiles are missing from a certain column (starting somewhere in the middle of this column). As you wrote that 2 GB would be the limit, this made sense - the lower 2GB (I did not verify the exact threshold) are visible, while the upper ones (I added the rightmost tiles last to the database) were missing.
To verify this, I made an identical tile database with dummy images (a 1.8 kB solid black tile), calibration, tile numbering etc. were identical. With this much smaller database, Oruxmaps displayed all tiles correctly, up to the right margin. So the whole process of tile writing (by my script) and reading (by Oruxmaps) is working fine, just a 3 GB database won't work.

Do you think that a 3 GB SQLite tile database should work?

- Martin

martin25

Cantidad de envíos : 18
Fecha de inscripción : 2011-12-05

Back to top Go down

Import multiple files, Swiss grid Empty Re: Import multiple files, Swiss grid

Post  orux Sun Jan 01, 2012 6:52 pm

martin25 wrote:
orux wrote:...
Hi, Martin;

I think fat32 limit per file is 4gb.

orux
Hi Orux,

here https://oruxmaps.forumotion.com/t574-map-size-and-optimum-settings you wrote it would be 2GB. I know that FAT32 can handle 4GB files, but I tried it and it doesn't work...

I have put all tiles in a 3 GB SQLite database. The left part of the map is perfect, calibration OK and everything. However, on the right side of the map, tiles are missing from a certain column (starting somewhere in the middle of this column). As you wrote that 2 GB would be the limit, this made sense - the lower 2GB (I did not verify the exact threshold) are visible, while the upper ones (I added the rightmost tiles last to the database) were missing.
To verify this, I made an identical tile database with dummy images (a 1.8 kB solid black tile), calibration, tile numbering etc. were identical. With this much smaller database, Oruxmaps displayed all tiles correctly, up to the right margin. So the whole process of tile writing (by my script) and reading (by Oruxmaps) is working fine, just a 3 GB database won't work.

Do you think that a 3 GB SQLite tile database should work?

- Martin

Hmmm;


Do not know where I read that information, but it seems that the limit is 4GB. A 3GB database should work.

orux
orux
orux

Cantidad de envíos : 3946
Fecha de inscripción : 2009-07-06

Back to top Go down

Import multiple files, Swiss grid Empty Re: Import multiple files, Swiss grid

Post  martin25 Mon Jan 02, 2012 9:42 am

orux wrote:
Hmmm;


Do not know where I read that information, but it seems that the limit is 4GB. A 3GB database should work.

orux
Hi Orux,

I recompressed my map tiles with a lower quality setting and now got a 1.7 GB database, which works fine! A 3 GB definitely does not, so there seems to be a limit somewhere between those. I searched in the internet but did not find any solid evidence of a database size limit. SQLite itself could handle hundreds of terabytes, but what the Android implementation could do is not documented. I found one more case where a 2.6 GB database failed on an Android device.

Once again this would ask for seamless display of multiple maps... Smile

- Martin

martin25

Cantidad de envíos : 18
Fecha de inscripción : 2011-12-05

Back to top Go down

Import multiple files, Swiss grid Empty Re: Import multiple files, Swiss grid

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum