AvnNav Charts

AvNav Charts and Overlays

Technical Background

To use charts in AvNav they have to be available in a tile format. This is a format used by services like OpenStreetMaps or GoogleMaps. A tile has (normally) a size of 256x256 pixel. The world is projected to a flat surface (imagine a paper cylinder wrapped around the earth at the aequator). Each point with it's coordinates (longitude/latitude) will pe projected at this cylinder. How this is performed in detail, which units will be used and whether the earth is considered as an ellipsoid or a sphere is described by the projection. AvNav is using the so called google mercator projection (earth considered a sphere) with the EPSG code 900913. The projected units are always meters (but can be converted to longitude and latitude). If you have charts using a different projection they have to be reprojected beforehand.

The whole projection area is split into tiles. The zoom level determines the number of tiles for the complete area. Zoom level 0 means:  complete earth (from -85°...+85°, outside these limits the projection is undefined) is shown in one tile of 256x256 pixel. With each other level there will be more tiles - level 1: 2x2 tiles, level 2: 4x4 tiles. The most relevant zoom levels for our usage typically range from 7 to 18..19. That means at level 19:2^19x2^19 tiles.
The openlayers library is used to display the charts. This library loads the tiles based on zoom level from the server (raspberry) and displays them on the screen. It is often used in OpenStreatMap applications.

You can easily imagine the huge numbers of tiles required for higher zoom levels (if you try e.g. zoom 19 for all). Therefore it makes sense to follow the same approach we take for paper charts: for an overview a small zoom level is used, detail charts a bit more and e.g. port approaches with the highest levels 18 or 19 (60cm/pixel and 30cm/pixel). To still maintain a nice display experience the different detail levels can overlay the other tiles of less detail. If there is a better (higher) zoomlevel for an area this one will be displayed - otherwise the one with a lower zoom level (potentially up scaled). To not overload the display devices, the number of layers should be limited to 3...5 (depending on the device).

Additionally AvNav can display vector charts from o-charts (using the ocharts or ochartsng plugins) and S57 charts (after conversion using the ochartsng plugin). Those vector charts are converted to the described tiles "on the fly" by the plugins.

You can get charts from various source - either already in formats that AvNav can directly use (gemf, mbtiles) or in formats that have to be converted (like BSB - .kap files).

There are also tools available to download such charts outside of AvNav or inside AvNav.

When converting charts the goal is to assign available charts to layers, to potentially reproject them and finally create the chart tiles (maybe together with a description). Typically this requires a lot of computing power (and time) and should be better run on a desktop system. But typically this should be no problem as you will do this only once. After you will be rewarded with a continous chart view with no gaps inbetween.
The same has to be considered when it comes to downloading charts. You need to carefully select areas and zoom levels.

Chart Formats

AvNav uses GEMF as its primary format. It is a compact binary format merging all tiles into one file with the necessary meta data added. This format permits special functions like automatic zoom level adaptation.  
Since version 20200325 AvNav can directly use the mbtiles format. To use this format you potentially have to select the correct variant of internal tile sorting. The default format is "xyz" but there is also a "tms" format available. You can switch the format at the Files/Download page. You can download MbTiles directly e.g. from OpenSeamap.

Hint: Up to version 202011xx AvNav was reading an entry "scheme" in the mbtiles metadata. Unfortunately the usage of this entry is not well defined and different sources are using differently (see Issue #63). In earlier editions AvNav internally inverted the meaning of xyz and tms. Since version 202011xx AvNav ignores this value (and assumes tms). If the value is set in the metadata, the chart will be displayed in red and you can visit the Download-Page to choose the type to be applied for this specific chart.

For the handling of the vector charts refer to the ocharts/ochartsng descriptions.

Chart Sources

You can get charts from various sources - either in a format that is directly usable by AvNav (.gemf, .mbtiles, o-charts) or a format that needs conversion before (.kap, s57).
There are tools available to download such charts - either within AvNav or outside.

A list of chart sources:


Installation of Charts

After installing AvNav there is one/a couple of online demo charts available. For real usage you have to install charts in AvNav.

How to do this depends on the chart type.

Directly usable chart types (gemf,mbtiles)

Upload them on the Files/Download page.
On Android you can also copy them directly to the external chart directory (gemf files only).
For mbtiles consider the option to switch the internal scheme at the Files/Download page .

Charts with conversion (kap, s57)

In normal versions (not Android) you can upload charts that need conversion at the Importer (starting from 20200325).
s57 charts require an installed ochartsng plugin.
You should keep in mind that converting can require a lot of CPU power and can last for hours on the raspberry pi. Probably it is more efficient to run this on a desktop system.
As the conversion functions are not available for Android, you could additionally install AvNav on a Linux- or Windows-System and run the conversion there. Converted charts can be downloaded from the importer and uploaded to the Android app.

Vector Charts (o-charts, s57)

Those charts require an installed ocharts or ochartsng plugin (on Android the avocharts app - see ochartsng). You cannot use those chart types on windows as the plugins are not available (except the converter from s57 to ocharts). For details refer to the ocharts/ochartsng documentations. S57 charts that have been converted will directly become visible in the ochartsng plugin.

Downloading Charts inside AvNav

If the MapProxy plugin is installed its charts will directly become visible in AvNav without any further installation.

Overlays

Since version 20201219 AvNav can display further information as overlay (or underlay). You can as well combine different charts.

For details see Overlays.

Download using Mobile Atlas Creator

To use the Mobile Atlas Creators you only need Java and the MOBAC itself. It is important to follow a certain procedure when selecting the ranges for download  in order to fit the charts to the described layer concept and to limit the amount of data.

Typically, I recommend to use 3 layers: overview( zoom level 7-10), navigation (level 10-15), details (Level 16-18). Afterwards just proceed in MOBAC layer by layer. Select the zoom levels for the layer, select the areas you want and add them with an arbitrary name. Repeat this for all layers. Now save your selection using a meaningful name (the xml file could be reused later). Select OsmDroid GEMF (File->convertAtlasFormat) as output format and start atlas creation. In the output directory a xxx.gemf file will be created. Install this on the pi.
At the mapsources page I present a collection of useful map sources.