Bílý vrch
icon TrekBuddy
www.trekbuddy.net
Outdoor companion.
  • internal / bluetooth / simulator GPS
  • offline raster maps
  • smart GPX / raw NMEA logs
  • waypoints and simple navigation
  • custom views
  • MIDP and Symbian phones
  • Blackberry
  • Android
Visit wiki to see all features, guides and howtos. Project tracker.

Partners:    (Polish/Polski)(Polski) Compass mapy      (Polish/Polski)(Polski) Galileos mapy      (Polish/Polski)(Polski) CartoMedia      (Czech/Èesky)(Èesky) Eaglesoft trasy      (Polish/Polski)(Polski) ExpressMap     

 FAQFAQ   SearchSearch   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
tar.exe

 
Post new topic   Reply to topic    TrekBuddy Forum Index -> Tools
View previous topic :: View next topic  
Author Message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5662

PostPosted: Fri Aug 31, 2007 2:09 pm    Post subject: tar.exe Reply with quote

Since package UnxUtils.zip seems to be unavailable, here's tar.exe from the package. It is command line tool.


tar.exe
 Description:

Download
 Filename:  tar.exe
 Filesize:  112 KB
 Downloaded:  1942 Time(s)

Back to top
View user's profile Send private message
marcinb



Joined: 29 Sep 2007
Posts: 2

PostPosted: Thu Jan 17, 2008 11:08 pm    Post subject: Reply with quote

Hi

Here is a windows script which compesses whole atlas.

To do it copy this file, and tar.exe to atlas folder and
execute make_atlas.
As output is created subfolder TARED (can be changed inside script).

I hope somebody will add another features to this script or write similar better one and will sheare his work.



make_atlas.zip
 Description:

Download
 Filename:  make_atlas.zip
 Filesize:  545 Bytes
 Downloaded:  824 Time(s)

Back to top
View user's profile Send private message
krezul



Joined: 26 Apr 2007
Posts: 1

PostPosted: Tue Feb 12, 2008 10:31 am    Post subject: Reply with quote

Hi,
This script is very usefull, but it skips folders and files with spaces in their names. Can it be modified not to skip spaces? I can't simply batch-rename the filenames - the map and set files would be invalid then...

thanks anyway for the script! Smile
Back to top
View user's profile Send private message
Guy



Joined: 16 Nov 2007
Posts: 10
Location: Kent, UK

PostPosted: Tue Feb 12, 2008 11:22 am    Post subject: Reply with quote

The downloads for the unix utilities are all on http://gnuwin32.sourceforge.net/

The tar there is the same as the one you posted, but version 1.13 instead of version 1.12

Choose Packages link on left, tar has its own download.


ps First post. Compliments on TrekBuddy, great piece of software.

_________________
Guy
HTC Desire HD, Android 4.0.4 (ICS)
Back to top
View user's profile Send private message
guest



Joined: 08 Oct 2006
Posts: 4916

PostPosted: Thu Mar 20, 2008 11:21 pm    Post subject: thanks Reply with quote

thanks!
Back to top
View user's profile Send private message Visit poster's website
marcinb



Joined: 29 Sep 2007
Posts: 2

PostPosted: Tue Mar 25, 2008 7:19 pm    Post subject: Reply with quote

Hi

I changed the script to support maps with space in the name.

No other changes.



make_atlas.rar
 Description:

Download
 Filename:  make_atlas.rar
 Filesize:  538 Bytes
 Downloaded:  982 Time(s)

Back to top
View user's profile Send private message
guest



Joined: 08 Oct 2006
Posts: 4916

PostPosted: Fri Apr 18, 2008 10:28 am    Post subject: Reply with quote

What an excellent batch file, thank you very much marcinb Smile I have been using a batch file to create the tar version of my map collections, but they are not generic like yours. I have to create a specific batch file for each of my map. Yours is 100 times better!

So, I did a few modification to it, and I hope it could be useful to you and others:

- Allowing the *.map and *.set's names to be different than the name of the layer. The resulting tarred files still have the same name as their layers (folders). This is because some of my maps *.map/set's names are different than their layer's names.

- The batch file is placed in the parent folder. So it's like this:
Quote:

[untar version folder]
tar.exe
maketar.bat


and after running maketar.bat it becomes:
Quote:

[untar version folder]
tar.exe
maketar.bat
[tar version folder]


To anyone who are not familiar with batch file, you should rename your untarred folder to "untar version" before running maketar.bat. You can change it to other name by editing the batch file using a text editor like notepad in this part:
Quote:

set source=%cd%\untar version
set target=%cd%\tar version


I'm really a novice at this, and would appreciate it if anyone can improve this further. Thanks again Smile
Back to top
View user's profile Send private message Visit poster's website
guest



Joined: 08 Oct 2006
Posts: 4916

PostPosted: Fri Apr 18, 2008 11:52 pm    Post subject: Reply with quote

I forgot to mention that if you copy tar.exe and maketar.bat to one directory in path like c:\windows, you can run maketar anywhere from the command line without the need to copy those files to the parent folder first.
Back to top
View user's profile Send private message Visit poster's website
wwwwgr



Joined: 16 Feb 2009
Posts: 2

PostPosted: Mon Feb 16, 2009 3:55 am    Post subject: Reply with quote

Ok,Thank you!
Back to top
View user's profile Send private message
thomast



Joined: 16 Jan 2009
Posts: 101

PostPosted: Mon Feb 23, 2009 10:13 am    Post subject: exclude jpeg Reply with quote

hi,
i use this nice script..

today i make some tb-maps in jpeg format.
(good enougth for googleterrain and MUCH faster)

and now the toplevel tar becomes a very big size.
In this file are normaly no maps:
tar -rf "%OUT_DIR%\%%~nL.tar" --exclude=*.png "%%M"

would be good to exclude also jpg files. Idea

i change one line to:
tar -rf "%OUT_DIR%\%%~nL.tar" --exclude=*.png --exclude=*.jpg "%%M"

tnx,
thomas



make_atlas.zip
 Description:
new version with jpg support.
this "patch" is based on the original version.

Download
 Filename:  make_atlas.zip
 Filesize:  565 Bytes
 Downloaded:  202 Time(s)

Back to top
View user's profile Send private message
ah



Joined: 11 Feb 2009
Posts: 7

PostPosted: Sun Mar 22, 2009 10:08 pm    Post subject: Reply with quote

Is anybody nifty enough to translate this valuable script into linux / Mac OS X?

Thousand thanks,
Norbert
Back to top
View user's profile Send private message
zbycz



Joined: 01 Feb 2009
Posts: 16
Location: CZ

PostPosted: Sun Aug 16, 2009 11:06 pm    Post subject: maptar2 Reply with quote

Hello,

i wanted a tool just for tarring untarred maps and renewing the index. So here it is. Smile


Code:
maketar v2.0 - Trekbuddy tarred atlas maker

  This tool will tar all maps in an atlas and create an index. Structure of the
  atlas folder must be like this: layer-dir/map-dir/map-dir.tar OR set/+*.map

  USAGE:   Drag+drop a folder containing the atlas on this program
           OR pass the path as the first argument
           OR create folder "atlas" in the same directory as this program



maketar2.zip
 Description:
maketar v2.0 - Trekbuddy tarred atlas maker

Download
 Filename:  maketar2.zip
 Filesize:  56.32 KB
 Downloaded:  248 Time(s)


_________________
Geocaching GPX cleaner ~ [CZ] Geocaching s TrekBuddym v mobilu ~ maketar2 - tarred atlas maker
Back to top
View user's profile Send private message Visit poster's website
billy06



Joined: 01 Oct 2008
Posts: 434
Location: Lowestoft U.K

PostPosted: Sat Sep 26, 2009 12:31 am    Post subject: Reply with quote

thanks for the script Very Happy
_________________
Nexus 5X, Nexus 5, Nexus 7 3G, HTC Sensation, nokia 5800. web:www.thetrekbuddies.co.uk . Twitter:http://twitter.com/TheTrekbuddies
Back to top
View user's profile Send private message Visit poster's website
Freddie



Joined: 11 Jun 2008
Posts: 71

PostPosted: Sun Nov 22, 2009 1:59 pm    Post subject: Reply with quote

Script compressing atlas (tarring untarred maps, creating TMI file and header "atlas.tar") on Linux (Ubuntu 9.04)
Copy this file to atlas folder, run terminal and execute "bash atlastar.sh"

Code:

#!/bin/bash
mkdir ./tmp
ls ./ | while read layer; do
test -d "./$layer" && {
   ls ./"$layer"/ | while read maps; do
   test -d "./$layer/$maps" && {   
      if find ./"$layer"/"$maps"/*.map &>/dev/null; then
         echo compressing: "$maps"
         cd ./"$layer"/"$maps"/
         rm -f *.set
         tar --remove-files -cf "$maps.tar" *
         cd ..
         cd ..
         fi
      if find ./"$layer"/"$maps"/*.tar &>/dev/null; then
         echo indexing: "$maps"
         mkdir -p "./tmp/$layer/$maps/set"
         tar -xf "./$layer/$maps/$maps.tar" --exclude=*.set --exclude=set
         mv *.map "./tmp/$layer/$maps/"
         tar -R -tf "./$layer/$maps/$maps.tar" > "./$layer/$maps/$maps.tmi"
         fi
      }
      done;
   }
   done;
cd tmp
echo creating: atlas.tar
echo "Atlas 1.0"> atlas.tba
tar --remove-files -cf atlas.tar *
mv  atlas.tar ..
cd ..
rmdir tmp


Freddie



atlastar.sh.zip
 Description:
script

Download
 Filename:  atlastar.sh.zip
 Filesize:  444 Bytes
 Downloaded:  49 Time(s)


_________________
K530 > K770 > J105 > DG300 > Huawei P8 Lite & PENTAGRAM P 3101
Back to top
View user's profile Send private message Send e-mail
Carinobi



Joined: 07 Apr 2010
Posts: 17

PostPosted: Tue Apr 13, 2010 7:35 pm    Post subject: Reply with quote

This is a modified make_atlas.bat that works in cases where special filenames are created, like images that contain letters after the extension, like image.jpg_0

http://www.trekbuddy.net/forum/viewtopic.php?p=34365#34365

It basically consists on replacing %%~nM for %%M and %%~nL for %%L because some maps are differenciated when created with mapping software one from each other in appending characters AFTER the dot in the filename, for example mymap.jpg_0 and mymap.jpg_1, that were created in the old bat as mymap.tar instead of mymap.jpg_0.tar like it should be.


Batch script to automatically convert Trekbuddy maps to tar and tbi format from original map-png/jpg. The bat must be put in the same folder that the .tba and the tar.exe with libiconv-2.dll and libintl-2.dll libraries.

You should use PNG images instead of jpg and create it with TBMapper or Mobile Atlas creator using the tile (resolution) size that best fits your phone, but this is not mandatory



Code:
@ECHO OFF

rem Set Directory name where Atlas is
SET OUT_DIR=TARED

REM
REM This line removes old out folder
REM
IF EXIST "%OUT_DIR%" (
   del /Q %OUT_DIR%
   RD /S /Q %OUT_DIR%
)
REM
REM This loop searches for folders(layers) and subfolders(maps)
REM and compresses content to TAR archive
REM
FOR /D %%L in (*.*) DO (
   IF /I NOT "%%L"=="%OUT_DIR%" (
      Echo Working on Layer %%L
      cd %%L
      FOR /D %%M in (*.*) DO (
         Echo    Compressing map %OUT_DIR%\%%L\%%M
         mkdir "..\%OUT_DIR%\%%L\%%M"         
         ..\tar -v -C "%%M" -cf "..\%OUT_DIR%\%%L\%%M\%%M.tar"  "%%M.map"  "%%M.set"  set
         ..\tar -v -R -tf "..\%OUT_DIR%\%%L\%%M\%%M.tar" > "..\%OUT_DIR%\%%L\%%M\%%M.tmi"
      )
      cd ..
   )
)
REM
REM This loop creates Atlas archive
REM
FOR %%L in (*.tba) DO (
   Echo Creating Atlas %%L
   tar -v -cf "%OUT_DIR%\%%L.tar" "%%L"
   FOR /D %%M in (*.*) DO (
      IF /I NOT %%M==%OUT_DIR% (
      tar -v -rf "%OUT_DIR%\%%L.tar" --exclude=*.png "%%M"
      )
   )
)
pause


UPDATE: Added verbose mode to the tar commands so you can see what is happening in ms-dos window.



make_atlas_modified.zip
 Description:
Batch script to automatically convert Trekbuddy maps to tar and tbi format from original map/png. The bat must be put in the same folder that the .tba and the tar.exe with libiconv-2.dll and libintl-2.dll libraries.

You should use PNG images instead of j

Download
 Filename:  make_atlas_modified.zip
 Filesize:  585 Bytes
 Downloaded:  180 Time(s)

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    TrekBuddy Forum Index -> Tools 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 cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group