Welcome guest, is this your first visit? Click the "Create Account" button now to join.
Page 1 of 11 123 ... LastLast
Results 1 to 10 of 102
  1. #1
    Master
    Join Date
    Mar 2015
    Location
    127.0.0.1
    Posts
    159
    Rep Power
    52

    Soft Mapdownloader Linux and MacOS

    { Go to the last page of this thread to find the latest version of the Sygic Mapdownloader Linux and MacOS }

    Hi,

    I 'm new here.
    Anyone interested in a downloadmaps-script for Linux and developing more/better ones?
    I 'll gladly post an example if you 'd like one.

    Regs,
    Last edited by keesdewit; 26th April 2015 at 21:07.

  2.    Advertissements


  3. #2
    Important User

    osiris4isis's Avatar
    Join Date
    Apr 2012
    Location
    Farside of the Sun
    Posts
    2,646
    Rep Power
    640

    Default

    Quote Originally Posted by keesdewit View Post
    Hi,

    I 'm new here.
    Anyone interested in a downloadmaps-script for Linux and developing more/better ones?
    I 'll gladly post an example if you 'd like one.

    Regs,
    Sure, post it.

  4. #3
    Master
    Join Date
    Mar 2015
    Location
    127.0.0.1
    Posts
    159
    Rep Power
    52

    Default

    #!/bin/bash

    # Set the releasetype
    # RELEASE=nt\.2014\.09
    RELEASE=ta\.2014\.09

    # Define your maps:
    # Nav Teq
    # URL=http://cdn.sygic.com/in-app-data/fleet/maps/$RELEASE
    # Tele Atlas
    URL=http://cdn.sygic.com/in-app-data/maps/Europe/$RELEASE

    WGET="/usr/bin/wget --tries=5"
    EXT="2dc cam hmp lma ne0 ne1 ne2 nhs pak pnm poi"
    ALL="alb and aut bel bih bgr hrv cze dnk est fin fra deu gib grc hun isl irl imn ita lva lie ltu lux mkd mlt mda mco mne nld nor pol prt rou rus smr srb"

    echo ""
    echo ""
    echo " SYGIC MAP DOWNLOADER - EUROPE $RELEASE "
    echo ""
    echo " Download base map? [69.3 MB] (Y/N) "
    echo ""
    echo ""
    read item
    case "$item" in
    y|Y) echo "do it"
    echo "Downloading the Base maps, this takes a few seconds";
    $WGET -o tmp $URL/wcl/wcl.lma -N -P Maps/wcl
    $WGET -o tmp $URL/wcl/wcl.pak -N -P Maps/wcl
    $WGET -o tmp $URL/wcl/world2.wtn -N -P Maps/wcl
    $WGET -o tmp $URL/wcl/world3.wtn -N -P Maps/wcl
    echo " Done downloading"
    ;;

    n|N) echo "Drop it";;

    *) echo "Not an answer according to Matthew 11:1-9"; sleep 3;;
    esac

    while :
    do
    clear
    cat << EOF
    ===============================================================================
    Sygic European roadmaps $RELEASE
    ===============================================================================
    Please enter your choice:

    (1) ALBANIA [7.72 MB] (25) LUXEMBORG [8.14 MB]
    (2) ANDORRA [219 KB] (26) MACEDONIA [7.49 MB]
    (3) AUSTRIA [84.2 MB] (27) MALTA [1.45 MB]
    (4) BELARUS [3.83 MB] (28) MOLDOVA [1.21 MB]
    (5) BELGIUM [96.4 MB] (29) MONACO [108 KB]
    (6) BOSNIA-HERZEGOVINA [15.4 MB] (30) MONTENEGRO [2.62 MB]
    (7) BULGARIA [54.1 MB] (31) NETHERLANDS [148 MB]
    (8) CROATIA [34.8 MB] (32) NORWAY [109 MB]
    (9) CZECH REPUBLIC [97.4 MB] (33) POLAND [209 MB]
    (10) DENMARK [60.7 MB] (34) PORTUGAL [112 MB]
    (11) ESTONIA [25.5 MB] (35) ROMANIA [50.0 MB]
    (12) FINLAND [150 MB] (36) RUSSIA [1.17 GB]
    (13) FRANCE [682 MB] (37) SAN MARINO [137 KB]

    (Q)uit

    ================================================================================

    EOF

    read item
    case "$item" in

    1) COUNTRY=Albania; MAPNAME=alb
    FOLDER=$MAPNAME\.$RELEASE
    for f in $EXT
    do
    $WGET $URL/$FOLDER/$MAPNAME.$f -N -P Maps/$COUNTRY/$FOLDER
    done
    ;;

    48) echo "choice is all"
    for MAPNAME in $ALL
    do
    FOLDER=$MAPNAME\.$RELEASE
    for f in $EXT
    do
    $WGET $URL/$FOLDER/$MAPNAME.$f -N -P Maps/$FOLDER
    done
    done
    ;;

    Q|q) echo "Bye!" ; echo ""; echo ""; echo ""; exit

    ;;
    * ) echo "Not the right answer (Matthew 13 : 1-9)"

    ;;
    esac
    sleep 1
    done
    Last edited by keesdewit; 4th July 2015 at 19:36.

  5. #4
    Master
    Join Date
    Mar 2015
    Location
    127.0.0.1
    Posts
    159
    Rep Power
    52

    Default

    The middel part, after "Please enter your choice:" appears bit sloppy, but in the shell it looks OK.

  6. #5
    Important User

    osiris4isis's Avatar
    Join Date
    Apr 2012
    Location
    Farside of the Sun
    Posts
    2,646
    Rep Power
    640

    Default

    Look good. Some advises:
    1. It should be possible to create metadata containing list of countries, their map name and their size (better if you can automatically pull the size). Then loop through it just like you did with the files using their extensions.
    2. Add basic retries just in case WGET failed for some reason.
    3. Add capability for getting map on other continents.

  7. #6
    Master
    Join Date
    Mar 2015
    Location
    127.0.0.1
    Posts
    159
    Rep Power
    52

    Default

    1. I am thinking about how to do this elegantly
    2. Done
    3. Thought you 'd never ask

  8. #7
    Important User

    osiris4isis's Avatar
    Join Date
    Apr 2012
    Location
    Farside of the Sun
    Posts
    2,646
    Rep Power
    640

    Default

    Quote Originally Posted by keesdewit View Post
    1. I am thinking about how to do this elegantly
    Doesn't WGET uses ftp to remotely download files? If so, most ftp version allow querying of file size without downloading the file first allowing you to get the filesize without having to hardcode it.

  9. #8
    Member + salsa's Avatar
    Join Date
    Mar 2015
    Location
    Italy
    Posts
    44
    Rep Power
    2

    Default

    Hi, i'm testing your script but it doesn't work:

    Code:
    Please Login or Register to see the links
    Thank you
    Last edited by salsa; 27th March 2015 at 20:01.

  10. #9
    Master
    Join Date
    Mar 2015
    Location
    127.0.0.1
    Posts
    159
    Rep Power
    52

    Default

    Salsa, try this script: [Only registered and activated users can see links. ]
    It works out of the box.
    Last edited by keesdewit; 27th March 2015 at 23:41.

  11. #10
    Master
    Join Date
    Mar 2015
    Location
    127.0.0.1
    Posts
    159
    Rep Power
    52

    Default

    wget does this also over http.
    As in:
    wget --recursive --level=inf --spider --server-response --no-directories --output-file="file.txt"
    You can then calculate the number of filesizes under "Content-Length" in the logfile like this

    #echo "Estimated size: $(grep -e "Content-Length" "$LOG" | awk '{sum+=$2} END {printf("%.0f", sum / 1024 / 1024)}') Mb"

    The only problem I have is, that either the first or the last file from the FOR loop makes it to the log file. I need them all there.

 

 
Page 1 of 11 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.