[Tasker] Openandromaps map downloader

Started by Tapio, January 07, 2022, 12:00:44

0 Members and 1 Guest are viewing this topic.

Tapio

Hi,

with this Tasker script you can automatically download OpenAndroMaps.

At first configure Task:
a) Configure which file(s) you wish to download, multiple items are comma separated. Full URLs! Like: http://ftp.gwdg.de/pub/misc/openstreetmap/openandromaps/mapsV5/germany/Ruegen.zip
b) Configure the target directory of your system, where you want the files to be. Like: /extSD/Android/media/menion.android.locus/MapsVector/OAM

Then you are ready to go. The Task first sends only a http-head command, compares file date of the zip file on server with your local maps file time and only downloads, if there's a newer version server side, or if you haven't got that map. So we're friendly to the server.

This is how it operates the downloads per url:

- Task downloads zip file to target dir
- Then it unpacks the zip completely AND OVERWRITES existing .map/.db/.poi
- zip file gets deleted
- .poi file gets deleted (unneeded by Locus)
- Next download

Use at your own risk, enhance task by yourself, I am not planning to add much security/error handling code. I'd use the script only if the whole process does not take too much time, if it takes minutes, not hours. Because by the nature of Tasker, this task may block execution of other tasks while it is running.

[snip - currently only working in Tasker beta]
Tapiola MFV4+ theme for OAM Maps:
Discuss - Releases - DL latest - Install latest
  •  

Saturo

Was mache ich verkehrt, wenn ich diese Meldung erhalte?

20.13.49/Variables doreplresult: |%last_modified| -> |25_Dec_2021_16:10:07|
20.13.49/E Error helper execute: java.lang.IllegalArgumentException: Invalid format: "25_Dec_2021_16:10:07" is malformed at "Dec_2021_16:10:07"
   at org.joda.time.format.b.b(Unknown Source:103)
   at com.joaomgcd.taskerm.action.f.s.a(Unknown Source:155)
   at com.joaomgcd.taskerm.action.f.s.a(Unknown Source:2)
   at com.joaomgcd.taskerm.helper.a.a.l.f(Unknown Source:106)
   at net.dinglisch.android.taskerm.ExecuteService.a(Unknown Source:402)
   at net.dinglisch.android.taskerm.ExecuteService.a(Unknown Source:278)
   at net.dinglisch.android.taskerm.ExecuteService.a(Unknown Source:0)
   at net.dinglisch.android.taskerm.ExecuteService$1.run(Unknown Source:489)
   at java.lang.Thread.run(Thread.java:764)

20.13.49/TD getStatic: Active load: true - ExecuteService
20.13.49/TD getStatic: Active load: true - ExecuteService
20.13.49/E Invalid format: "25_Dec_2021_16:10:07" is malformed at "Dec_2021_16:10:07"
20.13.49/E result: stop task (error)
20.13.49/E Fehler: 1
20.13.49/E Invalid format: "25_Dec_2021_16:10:07" is malformed at "Dec_2021_16:10:07"
20.13.49/MacroEdit action finished exeID 1 action no 15 code 394 status: Err next 15
  •  
    The following users thanked this post: Tapio

Tapio

#2
Nichts... That is a part of the code dealing with the servers file timestamp.
Please tell me the url you tried...

You can deactivate line 16,19, 26-28 and it will work, force download. Longtap and select lines, on/off symbol in top bar.

Which version do you use?. The date/time command in question is quite new, Tasker has to be up to date.

EDIT OK, you tried Germany south, works here. Please, if you don't mind, does this test task drop the same error or does it output a number?

https://taskernet.com/shares/?user=AS35m8kdDIMDeveQcQfRglam%2Fah1mTW%2FWcg05FZ39c0i1q%2F77iY3E7cIwxCkXqJTaTA%3D&id=Task%3Adatetimetest
Tapiola MFV4+ theme for OAM Maps:
Discuss - Releases - DL latest - Install latest
  •  

Saturo

I have tested with germany north and south.

Datetimetest also drops an error message:

10.45.06/E Error helper execute: java.lang.IllegalArgumentException: Invalid format: "25_Dec_2021_16:10:07" is malformed at "Dec_2021_16:10:07"
   at org.joda.time.format.b.b(Unknown Source:103)
   at com.joaomgcd.taskerm.action.f.s.a(Unknown Source:155)
   at com.joaomgcd.taskerm.action.f.s.a(Unknown Source:2)
   at com.joaomgcd.taskerm.helper.a.a.l.f(Unknown Source:106)
   at net.dinglisch.android.taskerm.ExecuteService.a(Unknown Source:402)
   at net.dinglisch.android.taskerm.ExecuteService.a(Unknown Source:278)
   at net.dinglisch.android.taskerm.ExecuteService.a(Unknown Source:0)
   at net.dinglisch.android.taskerm.ExecuteService$1.run(Unknown Source:489)
   at java.lang.Thread.run(Thread.java:764)

10.45.06/TD getStatic: Active load: true - ExecuteService
10.45.06/TD getStatic: Active load: true - ExecuteService
10.45.06/E Invalid format: "25_Dec_2021_16:10:07" is malformed at "Dec_2021_16:10:07"
10.45.06/E result: stop task (error)
10.45.06/E Fehler: 1
10.45.06/E Invalid format: "25_Dec_2021_16:10:07" is malformed at "Dec_2021_16:10:07"
10.45.06/MacroEdit action finished exeID 1 action no 0 code 394 status: Err next 0
  •  

Tapio

#4
What's your Tasker version and is it up to date? I'm on beta, but was convinced, the new but very unforgiving date/time command was already mature in stable version.
Tapiola MFV4+ theme for OAM Maps:
Discuss - Releases - DL latest - Install latest
  •  

Tapio

#5
Re-Download. As an intermediate solution, task will continue (but always download - no date check!) instead of stopping on the error. So the date check may only work for some users. Will find out.
Saturo, may you plase also download the datetimetest script again and let me know what it does? Is your Tasker updated?
Tapiola MFV4+ theme for OAM Maps:
Discuss - Releases - DL latest - Install latest
  •  

Saturo

I use version 5.14.6

Next Test with datetimtest drops again the error message:

23.21.47/E Error helper execute: java.lang.IllegalArgumentException: Invalid format: "25_Dec_2021_16:10:07" is malformed at "Dec_2021_16:10:07"
   at org.joda.time.format.b.b(Unknown Source:103)
   at com.joaomgcd.taskerm.action.f.s.a(Unknown Source:155)
   at com.joaomgcd.taskerm.action.f.s.a(Unknown Source:2)
   at com.joaomgcd.taskerm.helper.a.a.l.f(Unknown Source:106)
   at net.dinglisch.android.taskerm.ExecuteService.a(Unknown Source:402)
   at net.dinglisch.android.taskerm.ExecuteService.a(Unknown Source:278)
   at net.dinglisch.android.taskerm.ExecuteService.a(Unknown Source:0)
   at net.dinglisch.android.taskerm.ExecuteService$1.run(Unknown Source:489)
   at java.lang.Thread.run(Thread.java:764)

23.21.47/TD getStatic: Active load: true - ExecuteService
23.21.47/TD getStatic: Active load: true - ExecuteService
23.21.47/E Invalid format: "25_Dec_2021_16:10:07" is malformed at "Dec_2021_16:10:07"
23.21.47/E result: stop task (error)
23.21.47/E Fehler: 1
23.21.47/E Invalid format: "25_Dec_2021_16:10:07" is malformed at "Dec_2021_16:10:07"
23.21.47/MacroEdit action finished exeID 1 action no 0 code 394 status: Err next 0

Without date check, i prefer downloading the files manually.
  •  
    The following users thanked this post: Tapio