Page 1 of 1

[resolved] OfflineMaps+ - Extract some caches from .dat file ..

Posted: Sat Dec 12, 2015 3:46 pm
by Ramadnio
hi

i need to find a way to extract some caches from cache file of OfflineMaps that extention .dat file

ex.

i downloaded caches of england .. and the cache stored in this path..
OfflineMaps/cache/builtin-maps/OSMMPQ.DAT

how can i extract some caches area from this file "OSMMPQ.DAT" ?

please help
thx.

Re: OfflineMaps+ - Extract some caches from .dat file ..

Posted: Mon Dec 14, 2015 8:24 pm
by Psyberia-Support
Hi,
This .dat format is quite complex and no specs are available now.
Why not getting the data directly from where it comes, ie here, where it's simply available as images?

Re: OfflineMaps+ - Extract some caches from .dat file ..

Posted: Mon Jul 20, 2020 3:30 pm
by mzicoll
Well,
not so many answers here in the last years ;)

However, as e.g. OTM does not allow to download too many files at once, the cache saves some time, when re-using the tiles somewhere else...
So, I worked on extracting the cached tiles (IDX and DAT) and hopefully it helps somebody out there.

The code is not checked very well, but for me (AQ v 2.2.5d) it perfectly extracts some PNG on UNIX (Don't worry, should run on other "OS's" as well).
So please accept that this utility and code comes with absolutely no warranty!

Attached is a zip file, containing to jars, one executable, the other just containing the source code.
Some typical calls could be:

Code: Select all

  java -jar /path-to-jar/AqCache.jar  (general help)
  
  java -jar /path-to-jar/AqCache.jar  AqDatDump (specific help)
  java -jar /path-to-jar/AqCache.jar  AqDatDump OSMOTM.DAT (just list)
  java -jar /path-to-jar/AqCache.jar  AqDatDump -e png OSMOTM.DAT (list and extract)
  
  java -jar /path-to-jar/AqCache.jar  AqIdxDump (specific help)
  java -jar /path-to-jar/AqCache.jar  AqIdxDump OSMOTM.IDX (just list)
  java -jar /path-to-jar/AqCache.jar  AqIdxDump -e png OSMOTM.IDX (list and extract)
Maybe the IDX stuff does not really help, but if you want to understand the structure and/or extract specific tiles (or on the fly by other applications), you should understand the IDX.

I did not understand all of the bits and bytes in the IDX or DAT file, so the tool might not work always ;/

Give it a try, comments welcome :)
Martin

Re: OfflineMaps+ - Extract some caches from .dat file ..

Posted: Tue Jul 21, 2020 10:29 am
by Psyberia-Support
Thanks for the tool!