Tiles sqlite что за файл андроид
Перейти к содержимому

Tiles sqlite что за файл андроид

  • автор:

Android OpenStreetMap Offline Map Setup

Hello guys, last month I had to do some research on Android Offline Map usage for my freelance project. I can say map usage is kind a annoying for developers and there are rare documentations about offline map setup. So I decided to publish a offline map library.

After my research I decided to use OSM. In this article I will explain how to download map-tiles and how to use them on any Android app with using OSM and MOBAC.

If you want to use an offline map in your application, the user must download the tile set before using the map. And ready to go tile sets are really large files. If you still want to use ready to go map tiles, you can visit openmaptiles.com.

What should we do, If we do not want to force user to download map tiles ?

  • First we need to download MOBAC(Mobile Atlas Creator) from here.
  • Open MOBAC by clicking start shell script and select Osmdroid SQLite and click OK
  • Usage of MOBAC is really simple. You can choose any map source from left panel. Select map source (selecting osm is better) and zoom-levels (15–14–13–12 are ideal) as you desire. If you choose all zoom levels, your download size will inrease. I do not recomend it. As you know Google warns you about your application size 🙂
  • Next step is selecting a map area. In this picture I selected part of Istanbul for my usage. You can roam on map source with right click. Select your area and press ‘Add selection’ button from left panel.
  • After selecting desired area, press ‘Create Atlas’. You download will start. I recomend you to check ‘Ignore download error and continue automatically’.
  • When your download is finished your SQLite map tiles will be ready under Mobile Atlas Creator 2.1.2\atlases folder. You just need to remane it to map.sqlite and that is all. Our offline map source is ready to use 🙂 Lets jump to next step.
  • Now we can create our Android application. After creating our app, we need to copy our map.sqliteinto assets folder.
  • You will probably ask me to why we are copying sqlite file under assets folder, right ? Let me explain. If you use OSM and there is no internet connection, OSM starts to search any offline data understorage/emulated/osmdroid/tiles direction. Our code will transfer this SQLite file into this direction. This is also explains why program asks storage permissions at first opening 🙂
  • We need to add AndroidOfflineMap dependicies into gradle.

C’est ça!

Our offline map is ready to use !

You can go to github page from here.

Thanks for reading. If you have any further questions just ask 🙂

LM CLASSIC KNOWLEDGE BASE

Basics

FAQ

User guide

Main Screen

Maps

Tracks&Routes

Points

Map Items

Locus Store

Functions

Tools

Add-ons, Co-apps

Settings

Advanced
manual:user_guide:maps_external
You are here: main » manual » user_guide » maps_external
Book Creator

Book Creator

Table of Contents

External Maps

Locus Map can also work with external offline maps acquired from other sources — PC software, cartography publishers, and other map providers. It is necessary to copy these maps into your phone’s memory or on an SD card.

Adding external maps

There are a few options where to put the map files:

Locus/Maps directory

The default directory for the raster maps. You can add your maps here in several ways:

Import — open the Import screen from Locus menu or a function panel, find the map file in your device storage and confirm

Tap & add — open a system or any third-party file manager in your device, find the map file you want to add, and tap it. Locus Map is offered as one of the apps to load the file. Select it.

Android/Media directory

Raster maps

maps in SQLiteDB, MBT, Gemf etc. formats

/Android/Media/menion.android.locus.pro/Maps directory. It is placed both in the internal storage and on the external SD card so if you want to save some space in your external storage, use the latter.

Copy the map files into this directory via a system or third-party file manager
Restart Locus Map

Vector maps

maps in .map format, .db POI databases

/Android/Media/menion.android.locus.pro/MapsVector directory. It is placed both in the internal storage and on the external SD card so if you want to save some space in your external storage, use the latter.

Copy the map files into this directory via a system or third-party file manager
Restart Locus Map

Vector maps’ appearance can be changed by themes. The theme files must be placed in the default Locus/MapsVector directory. OpenAndroMaps themes — download them directly from their website, they’ll be imported on the right place by the app.

Supported Map Formats

There is a huge amount of map file formats and Locus Map is proud to be one of a few to support so many of them:

SQLite (*.sqlitedb)- plain SQLite database, with a tilestable, that contains x, y, z, image columns with required data. Coordinates are computed by the Slippy map system. SQLite files created by Locus Map when downloading online maps work fine but there can be problems with some SQLites from other sources. Some of corrupted SQLite databases can be repaired >>

TAR — as we mentioned before it is an obsolete map format, however, with a wide support and available map material. For example famous OZI Explorer. This software uses its own OZFX v2/v3 map format together with a calibration *.map file. TAR format is a very simple archive containing one *.map calibration file (including name, calibration points, datum, projection specifications and more) and map images.

MBT — MBTiles is SQLite based map format, maintained by MapBox company.

RMAP — an undocumented map format. Support by Locus Map is limited and not all projections and map format versions are working.

IMG — Garmin maps format. Locus is able to work with non-paid and unlocked maps in this format but is not able to detect their coverage — therefore some map features like auto-load or Quick map switch do not work with them.

GEMF (*.gemf) — GEMF Map Store Format is fast and efficient. It enables storing raster map tiles in the same format (PNG, JPEG only) as SQLite but in faster and more efficient way. Unfortunately it is not widespread much.

MapsForge (*.map) — The MapsForge project is aimed on support of OpenStreetMap based Android applications. It provides its own binary format for OSM data enabling applications render their own maps on-the-fly from raw information. More on MapsForge homepage.

OruxMaps — SQL-based format of maps designed for the OruxMaps application.
Backcountry Navigator, Gaia GPS, Maverick — their designated map formats

If you come across a map file in a format not included in this list and you would like to use it in Locus Map there is no need to worry. There is a lot of desktop conversion software to solve the problem.

manual/user_guide/maps_external.txt · Last modified: 2022/01/12 17:49 by mstupka

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International

Online-maps sources for OsmAnd

It’s no secret that the basic set of cards with which the application is supplied is often not enough. However, it is possible to add additional maps yourself. Here you will find two sets of raster online-maps:

How to install maps (Android)

Maps are presented in two formats. Theoretically, the maps are in the sqlitedb format should be loaded faster. On the other hand, you can easily delete the cache for metainfo maps. (Directly from the map folder). Anyway, you can download anything. But the Strava maps I recommend to download in the metainfo format.

  • If you have downloaded the zip archive you need to unpack it first.
  • If you have downloaded map file in .sqlitedb format, then copy this file to the folder on smatphone Android\data\net.osmand\files\tiles
  • If you want to download map in .metainfo format, then you’ll get zip archive. Unpack it. Copy unpacked folder to the Android\data\net.osmand\files\tiles
  • If for some reason you do not have such a folder (for example, Osmand is installed on the SD-card), then you need to know in which directory it is located. To do this, launch the application, open Settings , select Basic settings and scroll down to Storage Directory . Here you will find the address. Card you want to copy to the subfolder tiles

  • New maps should appear in the application in the tabs map Source , Coverage maps , substrate Map
  • If you need to remove any map from this list, you need to remove it from the storage of your phone using the File Manager app.

How to install maps (IOS)

  • Download map in sqlitedb format.

  • Find the downloaded file in the browser downloads list.

  • Open the file using Osmand.

  • The map should appear in the menu Map -> Overlay.

  • If you need to delete the installed maps, you can do it from the menu Map & Resources -> Installed -> Map Creator.

Attention! At the moment, working with additional online maps is only available in the Osmand version for beta testing.

How to set up the traffic layer?

I note that among the cards in this collection there are several dynamic. I mean all the maps with a layer of corrent traffic sitiation. There should also include a layer with moving ships Openseamap. It is worth noting that the application is not designed for such cards, so in order to be able to work with them will need to do additional settings each time.

Suppose you already have a dynamic map on your screen. For example, Google Traffic. Some time has passed and you want to know whether the situation on the roads has changed. To do this, you need to do the following:

  • Make sure that the updated map is not displayed on the screen. If the map is selected as the base layer, switch it to another layer. If it is selected as a substrate, simply turn off the display of the substrate.
  • Turn off OsmAnd to reset the cache.
  • Open OsmAnd.
  • Turn on the card you want to update again.

After these actions, the map will be reloaded. And if the condition of traffic jams has changed, you will see it.

That’s all. If you have any suggestions what other sources of maps should be added to the collection (and what to remove), then send me an e-mail. It is desirable to attach a link to the page with the map of interest to the letter. And, of course, report bugs and inaccuracies on the site.

Яндекс Навигатор ошибка базы данных и избранное #1

Отстраненная тема про «Яндекс Навигатор»(ЯН)
Совсем недавно еще была проблема как перенести избранное из одного устройства в другое и это решалось только одним способом, получив права root на устройстве и перейдя :
/data/data/ru.yandex.yandexnavi/favourites и скопировав файлик favourites на другое устройство по тому же пути.)
Все клево.
Но вот с недавних версий, однако прогресс не стоит на месте, перешли от текстовых и xml к облегченным базам данных (BD) и появилась синхронизация между устройствами при помощи аккаунта яндекса со всеми плюшками и минусами…))

Но не все так гладко как казалось бы, я столкнулся с ситуацией нетипичной, ГУ в моей машине на андройде 4.0.3 но как я убедился, этому глюку подвержены устройства вплоть до 6.
скачав обновление установилось и работало какое-то время, но после очередного запуска навигаторы появилась ошибка «чтения базы данных» и избранное стало недоступно, меню предлагало переставить поверх программу и/или перезагрузить устройство, что как не странно после этих манипуляций не помогло, а очень хотелось иметь избранные точки.печаль, но я малый рукастый и начал копать суть…
Сначала я угробил ЯН на своём телефоне, разобравшись восстановил работоспособность, принялся за ГУ.
Так как попытки поставить поверх ЯН не привела к положительному результату, я его просто снес, а зря, дальнейшие пляски с бубном установки как старой версии так и новой в разных вариациях вылились в то, что ЯН начинал грузиться и .после черного экрана вываливался на рабочий стол без каких либо ошибок, ааааа…
я 2 дня разбирался как его заставить работать и О чудо, спасают все те же права root на устройстве, все дело в том, что после удаления ЯН и последующей установки он писал о том, что все хорошо я поставился НО по какой-то причине он не мог создать директорию /mnt/sdcard/Android/data/ru.yandex.yandexnavi/…. путь похож на предыдущую версию но все же.

Что было сделано: Я на своем телефоне/планшете сделал архив этой директории ru.yandex.yandexnavi
которая на работающем устройстве может быть как :
/mnt/sdcard/Android/data/ru.yandex.yandexnavi/…
тут так и тут
/storage/emulated/0/Android/data/ru.yandex.yandexnavi/…
и на флешке перенёс на ГУ, там её разархивировал по пути /mnt/sdcard/Android/data/.
и о чудо после перезапуска ЯН всё заработало…
Но, есть еще один камень, если вдруг в очередной момент опять появится подобная ошибка при загрузке ЯН, не надо ломиться опять переписывать все директорию ru.yandex.yandexnavi достаточно как на фото ниже стереть один файл «cache.sqlite» не помогло, два файлика «tiles.sqlite» и «cache.sqlite» из директории /mnt/sdcard/Android/data/ru.yandex.yandexnavi/files/mapkit и при перезапуске ЯН их создаст заново.
НО при изучении данной проблемы выяснил, что он это делает не всегда и закономерности пока не выявлено, в такой ситуации остаётся только один вариант: удалить файл «cache.sqlite» и скопировать тот что изначально вы переносили с заведомо работающего устройства.
Есть предположение, что BD страдает при выключении ГУ после выключения зажигания так как это происходит в более грубом режиме чем на вашем телефоне/планшете под управлением Андроид.
Фух, осилил)) надеюсь в новой версии ЯН они поправят этот баг…
Кто осилил дочитать, спасибо.
Кому помогло, мне спасибо))
————————————————
Накипело.
Господа, кто репостит а точнее вырезает куски текста из моего поста, ну имейте совесть, ну не вы авторы, вы даже не знаете как рута поставить и постите, что вы так красиво все починили, будьте людми указывайте ссылку на статью…

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *