Technical articles

Creating a consistent user experience

Usability of our complex features is decisively enhanced by wording and good translations, and as much consistency as possible. It is worth thinking about many expressions or sentences for a little while :-)

Please try to adhere to the following points and conventions:

(1) Consistent Wording:

Use only _one_ expression for a certain feature, do not mix two possible expressions. Examples:

  • check for existing expressions and re-use them in new strings, also in translations,of course
  • use "navigation", not "routing", throughout.
  • use "tracking", not "monitoring"
  • understand that "position" is where you are, while "location" refers to arbitrary points
  • use "destination", not "target"
  • use "speed", not "velocity"
  • know the difference between "elevation" and "altitude"
  • It is "OsmAnd" now, not "Osmand" any more :-)

(2) Authoring Text:

  • Moreover, please try to re-use existing string constants as much as possible, it is good for memory and performance :-)
  • When changing existing strings, please double-check with _all_ their occurrences in the code
  • In general, please be short and precise. EVERY word you write should convey _necessary_ information, so be as precise and as short as possible. Unnecessary text clutters screens without helping much.
  • Please double-check appearance of wording in the app, in particular in low-density devices. Too many line breaks, cut-off text or blown-up menu buttons may make a screen almost unusable.
  • In some cases there are conventions, which may be worth checking, rather than "inventing something"... So if 99% of commercial navigation systems in your language announce "you have reached your destination", then using "you have arrived at where you wanted to go" may not be the best of choices ... :-)
  • Clearly mark all features which require Internet access with the expression "online"

(3) A note about rendering: The appearance our default renderer creates has been tested at a multitude of map locations, with many devices, and under very different light conditions. "Spontaneous improvements" to the renderer are almost always questionable, may at least require more investigation and testing than you may think ... :-)

Back to top

How to translate OsmAnd - we need your assistance!

We very much appreciate your help providing translations for OsmAnd! Provideing translations is not very complicated, the preferred way to provide string transaltions is described here: translate.osmand.net.

Additional Information
  • All translated strings are stored in resources, where you can check if there is already a 'values-{language}' directory for your language, e.g. 'values-sk' for Slovak.
  • Existing language files could be modified by editing the respective strings.xml file (requires a github account) as desired, but please use the easier way of prividing translations and corrections as described above. The master string data is kept in the english strings.xml file, please do also check out the hints I have added to the beginning of that file.
  • To create a translation for a new OsmAnd language, download the english strings.xml file, translate it and open an Issue at http://code.google.com/p/osmand/issues/list (requires a google account) announcing that a translation has been created
  • The same applies to theswing_messages_{language}.properties files in DataExtractionOsm project if you want to translate the map data extractor

Please use these described methods rather than publishing changes to strings.xml as issues or e-mailing them to the OsmAnd group.

Thank you for your help !

Q&A

Q: Which strings should I translate?*

A: In the strings.xml the strings look like:

        Save as GPX track
      
Translate only the 'Save route as GPX track' part. In the swing_messages.properties the strings looks like:
IndexCreator.INDEX_CITIES=Indexing cities...
Translate only the right part 'Indexing cities...'


Q: I don't want to create github or googlecode account, can I still post you the file?*

A: Yes, you can email the file, but still for us is the best way to use the github, it is easy.


Q: How should I check what has changed in the _english strings.xml_ ?*

A: New strings are added always on the top of the file. You can download the english file, your file and use some utility like pspad, or vim, or whatever you like to compare them for the new keys. You can also *blame* the english file to see the last line modifications

Back to top

What languages will be included in OsmAnd ?
Dear translators,

Thank you all very much for your efforts to complete our display language translations, and also to localize OsmAnd in more and more languages on Weblate.!

Please note the following: I am happy to include in OsmAnd's display language selection menu any new language with >10% translation rate, (will mark it as "incomplete" until it reaches ~80%). Please post an issue with OsmAnd if you need this done, I only sporadically watch these figures on Weblate.

Unfortunately, languages featuring 3-letter ISO 639-2 codes currently seem to have issues in Android, see e.g.
  • https://code.google.com/p/android/issues/detail?id=49120
  • https://code.google.com/p/android/issues/detail?id=106574
    This means that, unfortunately, any such language may not display in the OsmAnd menus on your device. (This issue only affects the language used in the app menus, not in the map, of course.)
  • Thanks,
    Dr. Hardy Mueller

    Back to top

    Documentation of OsmAnd Settings Development
    How to install the development environment
    Introduction

    The installation is not very difficult, here are the things you are required :

    • Java - 1.6, 1.7, 1.8 (compile target is 1.6!)
    • Android Studio
    • Android SDK
    • Optionally Andriod NDK (native code)
    • Downloads : tile maps, osm (osm.bz2) vector map depends on the area you want to work to. For country Belarus (Minsk) you can download directly from the "downloads"
    Details

    Java 1.6 is required. Download jdk to get source code of base java classes

    Android SDK is required. You will need two versions 1.6 and 2.2

    (Optional) Android NDK is required if you want to change and compile native code.

    You can download Android Studio here.

    To see results how you are working you also need map data :

    • To create tile maps you can use (MobileAtlasCreator) : create tiles for OSMtracker tile storage (now 'Mapnik' as source map is hardcoded), please use it.
    • You can find osm map for country through special sites. You can download small part of osm for town through JOSM (as example).
    • You also can use Internet : both swing application & android application can download tiles by itself from Internet.

    Setup the Environment Variables (e.g. in ~/.bash_profile):

            # The ANDROID_SDK and ANDROID_HOME are where Android studio placed stuff 
            export ANDROID_SDK=/[your-path]/Android/sdk 
            export ANDROID_NDK=/[your-path]/android-ndk-r10e 
            export ANDROID_HOME=/[your-path]/Library/Android/sdk 
            export JAVA_HOME=$(/usr/libexec/java_home -v 1.7) 
          

    Checkout the code and build it:

            $ mkdir Osmand 
            $ cd Osmand 
            
            $ git clone https://github.com/osmandapp/OsmAnd-resources.git
            # Rename the ressources
            mv OsmAnd-resources/ resources 
            
            # Checkout the Source Code
            $ git clone https://github.com/osmandapp/Osmand.git
            
            # Build the repo on the commandline to make sure everything works as expected
            $ cd OsmAnd
            $ ./gradlew --refresh-dependencies clean assembleFullLegacyFatDebug 
            
            # Make sure that you see: BUILD SUCCESSFUL
          

    Finally import the build.gradle file from the OsmAnd directory into Android Studio

    You can make your fork on github and work with it and do pull-requests to publish your work in OsmAnd's repository.

    Config Application

    You can run OsmExtractionUI.class and it is OsmAndMapCreator

    If you want to enable logging - do not forget to put Java VM arg

    -Djava.util.logging.config.file=​logging.properties

    After that you can try to run Swing (standalone) application to see whatever result.

    After that you should have installed the development environment on your machine.

    Back to top

    Voice Routing - Current Status (by Hardy)

    The current feature set is documented in each (new, v1.5-style) tts-config.p file in this comment block in the file header:

    % IMPLEMENTED (X) or MISSING ( ) FEATURES, (N/A) if not needed in this language:
    %
    % (X) Basic navigation prompts: route (re)calculated (with distance and time support), turns, roundabouts, u-turns, straight/follow, arrival
    % (X) Announce nearby point names (destination / intermediate / GPX waypoint / favorites / POI)
    % (X) Attention prompts: SPEED_CAMERA; SPEED_LIMIT; BORDER_CONTROL; RAILWAY; TRAFFIC_CALMING; TOLL_BOOTH; STOP; PEDESTRIAN; MAXIMUM
    % (X) Other prompts: gps lost, off route, back to route
    % (X) Street name and prepositions (onto / on / to) and street destination (toward) support
    % (X) Distance unit support (meters / feet / yard)
    % (N/A) Special grammar: (please specify which)
          

    The file's string contents are sorted accordingly, in this fashion we can easily check which file already supports which feature.

    Prompts

    Let me quickly document here which prompt is played when in our voice router module:

    1. "Route recalculated":
      1. Is played after the route has been recalculated, but only if the new route "is useful", i.e. now guides you in "forward direction"
      2. Is suppressed entirely for GPX routing (as it makes no sense then)
    2. "GPS signal lost":

      Is played after GPS signal has been lost for continuous 20 sec and this was not caused by user action (still buggy, see Issue 893)

    3. "Make a U-turn when possible":

      This prompt is an interim advice for cases where you continuously head in the wrong direction, and does only sound (once) if a new route in forward direction could not be found in x (currently 10) seconds:

      1. When you head down a long dead end road, where the only possible route out is 'backwards'.
      2. Where a new route in forward direction could not yet be re-calculated within the x seconds.
      3. The prompt is only played once, until the situation is resolved, i.e. you have either turned in the right direction, or route has been recalculated in "forward" direction.
    4. Turn instructions:

      Are suppressed if traveling in a weird directions (account for GPS issues)

    5. Lead distances (lead time):
    6. 1. CAR profile (DEFAULT_SPEED = 12m/s=43km/h):
      (a) >3000m out "Follow the course of the road for..."
      (b) 3000m-2000m PREPARE_LONG
      (c) 1500m-1200m PREPARE
      (d) 300m-168m (or <25sec) TURN_IN
      (e) <60m (or <5sec) TURN
      2. BICYCLE profile (DEFAULT_SPEED = 5m/s=18 km/h):
      (b) 500m-300m PREPARE_LONG
      (c) ~~500m-350m~~ 200m-120m PREPARE
      (d) ~~225m-80m (or <45sec)~~ 80m-60m (or <16sec) TURN_IN
      (e) ~~<45m (or <9sec)~~ <30m (or <6sec) TURN
      3. PEDESTRIAN profile (DEFAULT_SPEED = 2 m/s=7.2km/h):
      (c) ~~200m-150m~~ 100m-70m PREPARE
      (d) ~~100m-70m (or <50sec)~~ 50m-30m (or <25sec) TURN_IN
      (e) ~~25m or (or <12sec)~~ 15m (or <7.5sec) TURN

      (Corrected values for bike and ped from forum feedback June 2013.)

      Back to top

    Installation of different builds

    Different builds of OsmAnd should install over any other build of the same strain (older or newer) without any issues, and with all Offline data being preserved.

    The latest development build (not necessarily stable !) for testing can be found here.

    This will update over any more recent existing development build with no problems at all. Should trying to update produce a signing or "not installed" error (like if you currently use the market or a very old dev build), please

    • export your Favorites first (Menu/Export in the fav list)
    • uninstall the previous version
    • re-install the new development build
    • re-import your Favorites again (Menu/Import)

    All maps/tracks etc. are kept in place unchanged during this procedure.

    Back to top

    The map generation process
    Introduction

    Since OsmAnd has its own binary map format it is an OsmAnd initiative to generate/support and distribute these maps. OsmAnd can not update the maps frequently because it takes 2 weeks to process the whole world and only 1 out of 3 generations is successful. Most people are looking for a solution providing local maps.

    The tool OsmAndMapCreator helps to create maps in a non-automated way. This is only to process user-defined OSM maps or to use maps for your own purpose.

    On this page two methods will be described:

    • A fully automated way to update local maps frequently with the possibility to upload local generated maps to osmand.net to simplify life for others.
    • An automated way to create offline maps for yourself.
    Complete automated workflow with upload possibilities
    Prerequisites

    Prerequisites : *Jenkins*, *Java*, *Ant*.

    Automation is provided by the continuous integration tool called Jenkins. It will allow you to schedule jobs at whatever time you like and to utilize a lot of useful Jenkins plugins.

    Please configure Jenkins so that it is allowed to use Java and Ant from your machine. Don't forget to install the GIT plugin for Jenkins and to specify user.name and user.email.

    Steps overview

    There are 2 main steps : GenerateIndexes and UploadIndexes. You can have a look at continuous integration. GenerateIndexes downloads OSM files from different sources (defined in regions.xml) and generates OsmAnd files. After that, successfully generated files are moved to the indexes directory. UploadIndexes verifies generated files from *indexes* dir, moves them into the *uploaded* dir and uploads them through *ssh* to a specified server.

    OsmAnd continuous generation has the same steps except that it uploads to a different *ssh* (production) server. And there is also an additional step to move all uploaded files to a backup and start a completely new index generation. It is used when all indexes are generated.

    To monitor the whole process you can use the logs from this site. You can also see what files are currently generated work folder. You can see what files are about to be verified and uploaded dir and which have already been uploaded in the uploaded directory.

    Configure GenerateIndexes

    Schedule : Depends on you. You can run it every day 0 12 * * * or manually.

    SCM (source control) : _git://github.com/osmandapp/Osmand.git_ and Branch Specifier _origin/master_.

    Steps :

    • ant *clean compile jar* . Advanced DataExtractionOSM/build.xml.
    • Shell script
      mkdir ~/indexes && mkdir ~/indexes/uploaded
      
      rm -rf .work && mkdir .work &&  mkdir .work/osm
      
      if [ -z $INDEXES_FILE ]; then INDEXES_FILE="build-scripts/regions/indexes.xml"; echo "$INDEXES_FILE"; fi
      
      java -XX:+UseParallelGC -Xmx2048M -Xmn256M -Djava.util.logging.config.file=​build-scripts/batch-logging.properties -cp "DataExtractionOSM​/OsmAndMapCreator.jar​:DataExtractionOSM​/lib/*.jar" net.osmand.data.​index.IndexBatchCreator build-scripts/indexes-batch-generate.xml "$INDEXES_FILE"
                

    You can point $INDEXES_FILE to any indexes.xml and leave only regions you want to generate. Please also copy build-scripts/indexes-batch-generate.xml and update it to your local settings and replace _java_ program parameter to your local file.

    Configure UploadIndexes

    It is highly appreciated if you want to share generated indexes with others. You need to send your public key (id_rsa.pub) generated by ssh-keygen to the community (Google Groups). After that you will be authorized to *ssh jenkins@new.osmand.net* (to a master jenkins continuous generation). I think it would also be good to register at Jenkins through UI.

    Schedule : every 15 minutes to monitor indexes folder constantly for changes */15 * * * *.

    SCM (source control) : _git://github.com/osmandapp/Osmand.git_ and Branch Specifier _origin/master_.

    Steps :

    ant *compile jar*. Advanced DataExtractionOSM/build.xml.
          
    java -cp "DataExtractionOSM​/OsmAndMapCreator.jar​:DataExtractionOSM​/lib/*.jar" net.osmand.data​.index.IndexUploader /home/.../indexes /home/.../indexes/uploaded -ssh --url=ssh://... --user=jenkins --privKey=/home/.../.ssh/id_rsa --path=/var/lib/jenkins/indexes/
          

    The 1st argument is where the indexes to upload are laid, 2nd argument if the upload success where the files will be moved. Specify private key to authorize through ssh --privKey.

    Back to top

    Create offline maps for yourself

    OsmAndMapCreator can also be used to create maps for yourself if you want maps that are more up-to-date then the ones you can download from OsmAnd. We will explain this via a Un*x/Linux/OS X like shell script and we will use the nightly generated maps from Geofabrik, a German company that sells OpenstreetMap based maps and appliances.

    Shell script
    #!/bin/sh
    WORK_FOLDER="/opt/OpenStreetMap"
    # First download all the data
    cd "$WORK_FOLDER/osm_files"
    echo "Now in pwd\n"
    rm *
    wget -v -O Netherlands_europe.osm.pbf "http://download.geofabrik.de​/europe/netherlands-latest.osm.pbf"
    #wget -v -O Luxembourg_europe.osm.pbf "http://download.geofabrik.de​/europe/luxembourg-latest.osm.pbf"
    #wget -v -O Belgium_europe.osm.pbf "http://download.geofabrik.de​/europe/belgium-latest.osm.pbf"
    
    cd $WORK_FOLDER
    echo date > starttime.txt
    echo "Now converting from osm.pbf to osmand obf\n"
    cd "$WORK_FOLDER/OsmAndMapCreator"
    
    java -Djava.util.logging.config.file=​logging.properties -Xms256M -Xmx2560M -cp "./OsmAndMapCreator.jar:​./lib/OsmAnd-core.jar:./lib/*.jar" net.osmand.data.​index.IndexBatchCreator ./batch.xml
    
    cd $WORK_FOLDER
    echo date > endtime.txt
    
    echo "And finally moving the obf files from the index folder to the osmandmaps folder\n"
    mv index_files/*.obf osmandmaps/
          
    Explanation

    The line _WORK_FOLDER="/opt/OpenStreetMap"_ is a variable to set our working folder. Inside this folder we have the maps _osm_files_, _OsmAndMapCreator_, _index_files_ and _gen_files_.

    We move into our download folder _osm_files_ and we use the command _wget_ to download our map(s). The wget command is used with the parameter _-O <name>_ as we will download the latest nightly map from Geofabrik, but we will save it immediately in the nameformat OsmAnd prefers.

    We move into the folder _OsmAndMapCreator_ where we installed/copied the OsmAndMapCreator program. It is best to really use the program from this folder, otherwise you have to set all kind of environment variables. The line:

    _java -Djava.util.logging.config.file=​logging.properties -Xms256M -Xmx2560M -cp "./OsmAndMapCreator.jar:​./lib/OsmAnd-core.jar:./lib/*.jar" net.osmand.data.​index.IndexBatchCreator ./batch.xml_
          
    runs OsmAndMapcreator on our downloaded maps. OsmAndMapCreator will process all maps it will find in the download map. this also means that it will process older maps if you still had them there.

    We will log the process to file (-Djava.util.logging.config.file=logging.properties), give OsmAndMapCreator a minimum amount of 256MB and a maximum amount of 2560MB (preferably more then 1024MB), and we use the setup as specified in _batch.xml_.
    Note: a 32bit Operating system can address up to approximately 1.5GB. This means that your -Xmx value can no larger be then -Xmx1720M. A larger specification is accepted without errors, but not used.

    The _batch.xml_ file can be found in the OsmAndMapCreator folder, together with the program, and contains settings for running the program. The line:

    _process directory_for_osm_files=​"/opt/OpenStreetMap/osm_files" directory_for_index_files=​"/opt/OpenStreetMap/index_files" directory_for_generation=​"/opt/OpenStreetMap/gen_files"_
          
    specifies our working folders.

    The next line:
    _skipExistingIndexesAt="/..." indexPOI="true" indexRouting="true" indexMap="true"        indexTransport="true" indexAddress="true">_ 
          
    gives you options to modify parts of your map. If you don't need routing and/or addresses, you can simply skip these by setting the parameters to "false".

    You can also use multiple batch.xml files for different purposes.

    The last two lines in the script move the created maps to the osmandmaps folder where we store our maps (in this case).

    The lines

    _echo date > starttime.txt_ 
    
    and 
    
    _echo date > endtime.txt_ 
          
    are not really neccessary but simply display how long the process takes.

    Scheduling

    The shell script can be scheduled as well. You have to take notice of the Geofabrik schedule for the maps creations (calculate for your own time zone).

    If you want to create a new map every night, you could add a crontab line like:

    _01 03 * * 7 /opt/OpenStreetMap/​osm.pbf_to_obf_convert.sh > /dev/null 2>&1_

    This will start the creation of the map at 03:01 in the morning which is currently after the Geofabrik netherlands osm.pbf map has been generated (local time zone).

    Performance and tuning

    Creating maps is a memory hungry and very I/O intensive (disk intensive) process. In other words: It takes long to very long!

    What can you do to improve performance:

    • SSD disks.
    • Use multiple disks.
    • Use "in memory" processing.
    SSD disks

    The modern "solid state" disks are 2-6 times as fast as conventional hard-disks and can improve your map creation performance dramatically.

    Multiple disks

    Modern operating systems can access multiple disks simultaneously. Note that this really means *multiple disks* and *NOT* multiple partitions on one disk.

    If you have your _process directory_for_osm_files_ on one disk and your _directory_for_generation_ on another disk you will see an nice and noticeable performance gain.

    In memory processing

    You can do a great deal of the map creation not on disk but in memory. In your batch.xml one of the top lines contains:

    
          

    The osmDbDialect="sqlite" mapDbDialect="sqlite" determines where your map generation process will take place.

    The line osmDbDialect="sqlite" mapDbDialect="sqlite" means that it will take place on disk.

    If you change this to osmDbDialect="sqlite_in_memory" mapDbDialect="sqlite_in_memory" the process will take place in memory.

    This "in memory" processing will speed up the map generation by 10-50% but requires a lot of memory. The 10% to 50% is dependent on the map size. Smaller maps benefit less from in memory processing than larger maps, as still the normal disk access (initial reading and final map writing) plays a major role in smaller maps, where as the processing of all the data (and their relations) in larger maps requires more "calculation".

    In normal "on disk" processing a nodes.tmp.odb file is created from your .osm or .osm.pbf file. This nodes.tmp.odb file is a sqlite database file and it is about 15 to 25 times as big as the original .osm.pbf file which you downloaded from geofabrik.de.

    So if your original .osm.pbf file is 300MB, your nodes.tmp.odb file will be 5GB to 6GB! Note that smaller maps will be around the 15x factor whereas big maps (>350MB) will end up in the 20x to 25X space increase.

    With "in memory" processing this nodes.tmp.odb file will be created in your working memory. It means that the -Xmx parameter, which we discussed in the Explanation sections, needs to be big enough for both the nodes.tmp.odb and the normal processing that takes place in memory.

    You will need "the size of the nodes.tmp.odb" + 20-25%.

    It means that for a 250MB .osm.pbf, which will generate a ~4.5GB nodes.tmp.odb file, you need about 5GB heapspace which requires an -Xmx value of -Xmx5120M.

    Note: a 32bit Operating system can address up to approximately 1.5GB. This means that your -Xmx value can no larger be then -Xmx1720M. A larger specification is accepted without errors, but not used.

    So in effect you really need a 64bit Operating system to really benefit from "in memory" processing.

    Note also that your -Xmx value should not be that big that your operating system starts swapping to disk. This will even decrease your performance below that of normal "on disk" processing.

    Finally: your source .osm.pbf file can be no larger then 600MB as this would require up to 20GB working memory. If your source file exceeds 600MB, OsmAndMapCreator will switch back to normal "on disk" processing. You will be notified early in the process with a warning "Switching SQLITE in memory dialect to SQLITE"

    Back to top

    Creating a country polygon

    This article describes how to create a poly(gon) for a missing country in geofabrik.de and how to add this poly to the map generation server of OsmAnd

    Introduction

    OsmAnd comes with a lot of maps for a lot of countries. Most maps are created from "raw data" maps downloaded from geofabrik.de. Geofabrik supplies these raw data maps for free to everyone and they deliver (commercial) services and products based on these maps.

    Geofabrik.de has the strategy to deliver maps for the countries that are requested by larger numbers of users or by their customers. This means that some maps never make it on geofabrik as there are simply not enough requests for (or none at all), like some exotic countries like the Seychelles or Burundi, etc.

    Server process

    Because of this strategic decision of geofabrik, OsmAnd has an option to generate maps for these exotic rare countries and the tools OsmAndMapCreator and osmconvert are used for this. For OsmAndMapCreator this is a three step process:

    • OsmAndMapCreator needs a polygon which surrounds the outer border of the country.
    • OsmAndMapCreator needs the "raw data map" from the next level incorporating this country. For Burundi it mean that OsmAndMapCreator needs the Africa map. For Nordrhein-Westfalen it means that OsmAndMapCreator needs the Germany map.
    • Osmconvert will create a "raw data" map from the poly extracting the map data from the "parent" map.
    • OsmAndMapCreator will create an OsmAnd obf map based on the intermediate "raw data" map generated by osmconvert.
    Necessary actions

    Depending on the complexity of the (generated) polygon this complete chain of actions can take from 10 minutes to 2 hours in total.

    Get the OpenStreetMap relation from Nominatim
    • Go to nominatim.openstreetmap.org
    • Fill in your country name
    • Once found click on the link "(details)"
    • In Details scroll down to "OSM: relation " and write down or copy the relation ID number.
    Retrieve the poly(gon) from polygons.openstreetmap.fr
    Generate the polygon
    • Go to polygons.openstreetmap.fr
    • Fill in (or paste) the "OSM: relation " ID number you retrieved from Nominatim for your desired country into the "Id of relation" field.
    • This will create a default polygon, consisting of 250 to 3500 nodes (NPoints). The poly itself can be found in the "poly" column.
    • In case of more then 350 nodes you will need to simplify the polygon. The simpler the polygon, the faster the country map can be created (of course depending on the contents)
    Simplify the polygon

    The number of Node Points (NPoints) needs to be as low as possible for the fastest possible creation of the map by OsmAndMapCreator. As mentioned: In case of more then 350 node points try to reduce them by simplifying the polygon.

    • In case of more then 350 nodes, try to reduce them by "playing" with the X variable (in my experience the others don't really matter)
    • Sometimes you get great results (90 NPoints, 200 NPoints, 270 NPoints) and then you are done with this step. Sometimes you simply can't get below 450 NPoints or so. Then you need to apply further manual steps.
    • Save your final polygon to file. Use the correct default name for it, like france.poly. Stick to lowercase characters.
    Further modification and simplification of the polygon
    • Open JOSM (download if necessary) and open the polygon file you created (did you make a copy/backup of the original polygon that you saved?).
    • Add a background from the "Images" menu and select the default "OpenStreetMap (Mapnik)" background.
    • Manually remove node points where possible. *Note:* Keep the polygon as close as possible around the border. You do need some overlap but try to keep it below 2-5 kilometers. Overlap in countries will be generated twice for each country. Less overlap, means less rendering time and rendering errors. At coastlines and around islands try to keep more distance (20 kilometers). This is widely acepted and the sea is "empty" anyway.
    • When you have done the best you can you can save the updated, corrected poly. As said: try to get as little node points as possible, but sometimes a country border is so complicated that you simply need more node points to describe it and to keep the polygon as close as possible around the border: so be it.
    • *Do not upload the polygon to OSM*. JOSM will ask you to upload your work to OpenStreetMap. Don't do this for these polygons unless you know exactly what you do. Almost every country in the world is already perfectly covered in OpenStreetMap (otherwise nominatim would not be able to give you the details about the country, and polygons.openstreetmap.fr would not be able to generate the polygon based on the OSM relation id.)
    Adding the poly(gon) to the OsmAnd server

    To be able to do this you must register as a user.

    To make the map generation possible there are two steps required:

    • Adding the polygon to the map data section
    • Adding the country to the data file that is used to generate the OsmAnd obf maps.
    Adding the polygon to the map data section
    • Go to the web address of the OsmAnd development server at https://github.com/osmandapp/
    • Select the OsmAnd-misc section.
    • Select "fork" to create your own personal repository
    • In your personal repository go to the folder osm-planet/polygons and select the relevant continent.

      Note: The "master" repository is at github.com/osmandapp/OsmAnd-misc. Your repository is at github.com<your user name>/OsmAnd-misc.

    • Create a new file and copy your poly data inside. Save the file.
    • Create a pull request.
    Add the map creation to the batch list
    • Go to the web address of the OsmAnd development server at github.com/osmandapp
    • Select the OsmAnd-tools section.
    • Select "fork" to create your own personal repository.
    • In your personal repository go to the folder obf-generation/regions.
    • Select the file indexes.xml and click edit.
    • Add your country at the relevant location and save the file.
    • Create a pull request.
    Creating your own personal maps from a poly

    You can create for example polygons from countries, counties/provinces/states, regions and cities.

    Say your daughter is going to Paris for a couple of days with a friend. She is not interested in navigation, walking or cycling (unless absolutely necessary), but she wants to know where she is, where to go to and where to find the interesting places (POIs). Next to that she has a small phone (low end CPU, low on memory) and small SD-card (stuffed with music). So the map needs to be as small as possible: both for storage as well as performance. You can of course download the map for france_ile-de-france.obf containing Paris, but you can also generate a "custom made" Paris map.

    • Let your daughter download OsmAnd, or even better: let her buy OsmAnd+
    • Get the OSM relation id for Paris from Nominatim.
    • Get the (simplified) poly for the Paris id from polygons.openstreetmap.fr
    • download or compile osmconvert
    • download "raw data" map of ile-de-france from geofabrik.de
    • create raw data map of Paris from the ile-de-france map and the Paris poly like
       $ osmconvert ile-de-france.osm.pbf -B=paris.poly --out-pbf > Paris.osm.pbf
    • Download the OsmAndMapCreator application from download.osmand.net/latest-night-build/
    • create your OsmAnd obf map from the Paris.osm.pbf data map using OsmAndMapCreator.

    Back to top

    OsmAnd Data Structure
    Introduction

    Regarding many questions, issues about map data in application that topic unveils technical details of internal data format and data processing. It can be interesting for non-developers but who is familar with OSM data structure.

    All the OsmAnd data is containing in 'obf' files. 'obf' files have complex structure and can consists of many part. It is higly not recomended to have files around or more than 2 Gb. Currently obf parts can be many POI parts, many Map parts, Transport parts, Adress parts. That list can be extended in future. To combine or split or delete some parts from obf file use 'binary_inspector' console tool provided with OsmAndMapCreator.

    POI, Transport part
    Map part
    Address part

    Q: How does mapcreator generate its list of all places that will appear later in OsmAnd's offline address search? What objects are used in detail for that? What nodes with a place tag are included, and which are excluded?

    A: All places that are visible in OsmAnd as Cities are taken from nodes that has tag place https://wiki.openstreetmap.org/wiki/Place. Currently are used city, town, suburb, village, hamlet.


    Q: How does mapcreator handle an area polygon that is given via a relation with boundary=administrative? How do you associate a place given as a node with its boundary when it is present in the OSM data?

    A: Simply saying it works by name currently. Mapcreator tries to visit all boundaries and create closed (!) boundary from relation or from separated ways and associate with one of the name. After that it tries to match *place* with *boundary name* by *contains of* algorithm. Also there is additional check that boundary contains the place. If there are many boundaries of different admin_level with the same name (containing each_other like district/town/region has same name) the highest admin_level with exact matching will be chosen. TODO More details should be here (about districts of the city ...) ...


    Q: Where is a documentation what admin level is right to build an association to a certain place node? What countries prefer what admin level?

    A: Currently admin_level is Currently association between admin_level relation and admin_centre is not used. Because only few relations provides that information.


    Q: How does mapcreator know what street belongs to what place? Are there different cases when a boundary polygon is given and when there is none?

    A: There are many strategies to check and they are prioritized :

    • The most important are places and their boundaries. In order street management algorithm will work fine the place matching boundaries should be successfull. If the street belongs to many boundaries it will be registered in all appropriate places.
    • is_in tag (it is deprecated). So if street has is_in tag, it will be parsed and splitted by comma and street will be attached to all cities (by exact name matching). (TO CHECK: basic check street is in city radius?)
    • If the street doesn't belongs to any boundary (boundary were not properly closed could be an issue) it tries to find the closest/biggest city and register in it (sometimes it register in town for 1 km and missing 100m closest hamlet).

    The last part is very inaccurate that's why many streets get attached to a neighboor city.


    At mapcreator's preferences you have five more settings for street suffixes, zoom, smoothness and rendering ... what are the detailed effects that you can achieve with each of them? Are those settings actually used?

    Tools
    • OsmAndMapCreator can display what streets are associated to what city (context menu -> Show address). Local obf files should be present and configured in Settings.
    • Binary expector tool can show list of streets for each city. Run it to see parameters.
    • Currently all index files contain gen.log. Viewing the log file you can find errors in map creation process and that could an answer why some streets are not in the proper address index place.
    Address Part - workflow

    There are these relations:

    city -> 0..1 boundary
    boundary -> 0..** city (used to define suburb of city)
    1. iterate all Osm NODEs and register as cities if the tag = PLACE is present.

      • extract cities (TOWN, CITY)
      • extract villages (anything else)
    2. iterate all RELATIONs and WAYs with type=boundary and register all boundaries

      • boundary is called Entity (way or relation) with tag 'boundary=administrative' or with tag 'place=...'
      • boundary should be admin_level > 4 or don't have it
      • boundary is not always associated with a city (or state, ...).
      • boundary can have 'admin_center', 'label' member pointing to a city node
      • boundary exactly matches by name city node and city node is in boundary
      • boundary matches start, end or substring by name city node and city node is in boundary

      Many boundaries can be associated with one city. Here is the order how the most important boundary is taken and associated with the city

      • Boundary is matched by name exactly and has tag place
      • Boundary is matched by name exactly and has admin_level 8 > 7 > 6 > 9 > 10 > 5... or nothing
      • Boundary has admin_id matching
      • All other cases including sorting of admin_level
    3. If the city doesn't have any assigned boundary then all boundaries that doesn't have center cities and contain that city will be checked and the boundary with admin_level >=7 will be assigned.

    4. for each boundary, make a list of cities that are in it.

    5. iterate all RELATIONS and find addresses (Postal_Addresses)

      • relation with "address" tag type, and is "house" or "a6" address_type
      • search for associatedStreet relation and house members
      • try to find the city for the street and city for house address.
      • look up cities (we already must have find it in steps before!!)
      • if we have city and street, register it to database:
        • for streetregistration, see: register street for a city
          • if street is registered, and we are processing street:
          • iterate over all relation members:
            • find street -> write the nodes of the street to db
            • find house -> write the house to to the street
          • if street is registered, and we are processing house:
            • find house number
            • find house border: if found, store: building for the street

          register street (street, location of street (los), cities):

          Note: we might register street for more cities = this means, the street can be in nested areas, suburb, city, hamlet, etc... For each area, we want to register the street in it.

          • for each city:
            • find existing street registration within the city:
              • if street exists:
                • if city part is unknown -> update the existing street's city part
                • try to find cityPart for our street, and lookup the street again
              • if street does not exists: (might change after the lookup)
                • register the street for city, city part, location, and street name
        • findOrRegister street

          • find close cities to the street
          • if the street is in the boundary of the city, add the city for search
          • if no city was find, using boundary, find closest city for the street
          • :register street: for the found cities
    6. iterate all NODES than WAYS than RELATIONS (iterate main entity)

      1. find ways - interpolations:

        • for each interpolation, findOrRegister a street with the location of the interpolation
        • for each two nodes create a building representing the interpolation
      2. for any entity, find addr:housenumber and addr:street tag (can be also the interpolation nodes again!!!)

        • skip if building for this entity already exists!
        • findOrRegister streets for the street
        • find the house number
        • if housenumber contains '-', try to create interpolated house number (missing latlon2?)
        • if housenumber contains '/', try to lookup second street addr:street2 --> seems only for RU osm:
        • there are more variations for this: adr:housenumber2, addr2:street, addr2:housenumber etc...
        • for each street, store the existing house
      3. for way with tag - name & tag - highway, but without addr:housenumber and addr:street:
        • Note: this might be ways for cars, with names (highway, or so)
        • skip if such street exists already
        • findOrRegister the street for city
        • write the nodes for each found street in each city
      4. Each relation with "postal_code", store for later use.

        Note: this does not include the address:type = pc and addr:postalcode

    7. process post codes

      • for each stored postal_code relation
        • for each building member, update the postal_code
    8. write the index:

      • split cities to: citties+towns, suburbs (suburb with is_in tag), villages (not city or town)
      • write cities+towns using suburbs
        • read street from cities+tows + apropriate subburs for each town
          • in here, there might be more streets with same name for one city, in such case we try to find a cityPart for the street (suburb), where the street is in. There should be not more streets with same name within one city part!
        • for each street
          • for each building, register/create/find postcode, register the street
      • write villages
        • same as towns...
      • write extracted postcodes and their streets

    Back to top

    How to inspect an obf binary file

    If you want inspect the content of obf file, you need to download OsmAndMapCreator. There you can find a console application BinaryInspector (.sh, .bat). This console application has optional parameters [-vmap, -vaddress, -vtransport] and one required parameter (input obf file). By specifying optional parameters you could trace the whole information from obf file (be aware it could be huge!).

    Example and step-by-step for Windows users:

    • have Java Runtime Environment installed
    • download or copy any Osmand offline map from your device to your PC, place that obf file ideally in the folder with all the unzipped Mapcreator files
    • Open Windows commandline (e.g. by pressing Windows-key and "r", then enter cmd and press return
    • go to the folder where you have unzipped the Osmand-Mapcreator by command cd and folder name
    • type dir to see whether you are in the right folder with file inspector.bat
    • type inspector -h to see some help text
    • type inspector -vaddress name_of_your_map.obf >output.csv
    • if you get a Java console error about not enough memory or similar, edit the file inspector.bat by increasing the number at parameter -Xmx512M (or similar) step-by step to a higher value
    • try to load that (eventually very big) CSV text file into any editor or program that can load very big files, like Notepad++ ... or try an import into any spreadsheet programm like Excel or LibreOffice calc (choose TAB as field separator)
    • use any search feature to find place names or street names

    Back to top

    OBF routing debugging on a PC with OSM map display
    How-to
    • go to http://osmand.net and download OsmandMapCreator.zip from the link on the right screen side, and unzip it,
    • copy the obf file from your phone or tablet into that folder,
    • start OsmandMapCreator via bat file or sh file,
    • be sure to have an internet connection so that mapcreator can download map tiles, check all menus and settings inside mapcreator,
    • set the working directory of mapcreator to the folder where mapcreator itself and the obf file is located.
    • pan and zoom the map to that place where you have routing issues and that is covered by the mentioned OBF file,
    • do right clicks in the map to set start and end points and different routing engines
    Find the place name to what a street is associated in offline OBF maps
    • Have a Java framework installed on your desktop computer.
    • Download Osmand's Mapcreator, for example from download.osmand.net/releases and unzip it to your PC.
    • Take any map file with extensiuon OBF and put it in the same folder where all files from mapcreator are located.
    • Start Mapcreator on your PC by clicking OsmAndMapCreator.bat or OsmAndMapCreator.sh
    • Be sure that you have internet access on your PC, and Mapcreator's settings are that tiles are downloaded when you drag and zoom the map to your location where your issue is located.
    • If you have zoomed to your area, do a right-click with the mouse on the map and choose "show address" from the popup-menu.
    • Normally, now all the street names should be displayed from the obf file, and the place name to where each street is associated in Osmand's offline search.

    Back to top

    OsmAnd Server Configuration
    Introduction

    This document describes the steps needed to fully setup OsmAnd server for services needed by osmand and relateds stuff to it.

    Mail
    #Optionally remove the sendmail if present
    apt-get purge sendmail-base
    apt-get purge sendmail-bin
    #Install the postfix and utilities
    apt-get install postfix
    apt-get install mailutils
          

    Postfix setup: PostfixBasicSetupHowto or dpkg-reconfigure postix and setup the mail

    jenkins.osmand.net: Jenkins - builds and indexes
    apt-get install jenkins
    apt-get install openjdk6
          

    Plugins needed in jenkins: (todo list)

    /var/lib/jenkins

    In case of existing jenkins site, complete jenkins configuration can be copied: (link on jenkins wiki)

    install android sdk - /var/lib/android-sdk-linux (steps)

    on 64 bit system install 32 libs: apt-get install ia32-libs

    maybe you will need to change jenkins jobs configuration to point the builds to android-sdk-linux location using the sdk.dir variable

    Copy debug.keystore to /var/lib/jenkins/.android/debug.keystore take it from git: (link)

    add jenkins to group www-data

    Apache
    apt-get install libapache2-mod-php5
    apt-get install php5-mysql
    cd /etc/apache2/mods-enabled
    ln -s ../mods-available/rewrite.load
    ln -s ../mods-available/proxy.load
    ln -s ../mods-available/proxy.conf
    ln -s ../mods-available/proxy_balancer.load
    ln -s ../mods-available/proxy_balancer.conf
    ! copy sites (git, todo...)
    cd /etc/apache2/sites-enabled
    ln -s ../sites-available/*
    service apache2 restart
          

    ! apache configuration is not yet in git, should be there !

    For putting jenkins under ssl:

    • a2enmod ssl
    • a2enmod headers
    • a2enmod proxy_http
    • create self signed cert:
      make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/ssl/private/jenkins.crt
    • the ssl virtual host can server as jenkins.osmand.net
    • change the ssl file in the ssl virtual host conf:
      #SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
      #SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
      SSLCertificateFile /etc/ssl/private/jenkins.crt
                
    • see this to bind apache to jenkins
    • add this to ssl site config:
      ProxyRequests     Off
      ProxyPreserveHost On
      
      
        Order deny,allow
        Allow from all
      
      
      ProxyPass         /  http://localhost:8080/
      ProxyPassReverse  /  http://localhost:8080/
      ProxyPassReverse  /  http://jenkins.osmand.net/
                
    • the default site can have ServerAlias on jenkins.osmand.net and rewrite rule:
      RewriteEngine On
      RewriteCond %{HTTPS} off
      RewriteCond %{HTTP_HOST} jenkins.osmand.net
      RewriteRule (.*) https://jenkins.osmand.net%{REQUEST_URI}
                
    download.osmand.net

    If migrating from existing server:

    copy /var/www/www-download completely to the new server (note, this location is used by scripts, do not change!)
          

    Or, create from scratch:

    copy from git config/site to /var/www/www-download
          
    www.osmand.net (joomla)
    copy /var/www/www-joomla completely to the new server
    (todo)
          

    Copying a Joomla website

    tar cvfz joomlabackup.tar.gz /path-to-joomla
    scp joomlaback.tar.gz someuser@remote.machine.etc
    mysqldump -u joomla -p joomla > joomladb.out
    scp joomladb.out someuser@remote.machine.etc
          

    On remote machine:

    apt-get install mysql-server mysql-client //don't forget the password for mysql root user
    mysqladmin -u root -p create joomla
    mysql -u root -p mysql //we are going to create joomla user
    mysql> {{{ GRANT ALL PRIVILEGES ON joomla.* TO joomla@localhost IDENTIFIED BY 'password'; }}} //use the password configured for joomla, configuration.php
    mysql>  flush privileges;
    mysql -u joommla -p joomla < joomladb.out
    cd /var/www-joomla/
    tar xvfz joomlabackup.tar.gz
          
    Awstats
    apt-get install awstats
    copy /etc/awstats/* or get it from git
    copy /var/lib/awstats/* to new server to preserve data
    cd /etc/apache2/conf.d/
    cp /usr/share/doc/awstats/examples/​apache.conf awstats.conf
          

    read also: http://www.debianhelp.co.uk/awstats.htm

    !change permissions of apache logs so that awstats can read them!

    put a prerotate script to apache2 in /etc/logrotate.d/

    prerotate
    if [ -x /usr/share/awstats/tools/update.sh ]; then
     su - -c /usr/share/awstats/tools/update.sh www-data
    fi
    endscript
          
    service apache2 restart
          
    Geo::IP instalation for awstats

    overview: http://www.maxmind.com/app/installation

    apt-get install geoip-database
    apt-get install libgeo-ip-perl
          

    Now see: http://the.new.site/cgi-bin/awstats.pl

    uiman
    • adduser uiman //and password!
    • copy /home/uiman/* to new server
    • edit uiman's crontab
    • crontab:
      MAILTO=​pavol.zibrita+uiman@gmail.com,​victor.shcherb+uiman@gmail.com
      /1 * * * * /home/uiman/uiChanges.sh
                
    • cd /home/uiman; ln -s uiChanges-git/OsmAnd/ repository
    DNS

    if needed, change the dns settings accordingly on the new server provider (currently https://robot.your-server.de/)

    translate.osmand.net
    • user www-data (?)
    • cd /var/www/
    • git clone https://github.com/nijel/weblate weblate-git
    • ln -s weblate weblate-git
    • cd weblate
    • vim weblate/settings.py
      ...
      ADMINS = (
         ('Pavol Zibrita', 'pavol.zibrita+weblate@gmail.com'),
      ) ... 'ENGINE': 'django.db.backends.mysql' ... SERVER_EMAIL = 'pavol.zibrita+​weblateadmin@gmail.com' ... DEFAULT_FROM_EMAIL = 'pavol.zibrita+​weblateadmin@gmail.com' ...
                
    • git commit (currently the changes are commited, doing rebase for new releases)
    • install, what is needed in INSTALL
    • ./manage.py syncdb
    • ./manage.py migrate (needed when upgrading, read the DOCS!!!)
    • use apache config found in the project
    • install apache wsgi gateway
    • create apache virtual server for weblate, like translate.osmand.net
    Backup

    http://duply.net/?title=Main_Page

    http://trick77.com/2010/01/01/how-to-ftp-backup-a-linux-server-duply/

    apt-get install duplicity gpg ncftp

    read the trick77.com page for setup

    /etc/duply/offsite/conf:
    {{{ 
    GPG_KEY='F61826A6' 
    GPG_PW='*******' 
    TARGET='ftp://*****:******@****.your-backup.de/dailybackup' 
    SOURCE='/' 
    MAX_AGE=2M 
    MAX_FULLBKP_AGE=1M 
    DUPL_PARAMS="$DUPL_PARAMS --full-if-older-than $MAX_FULLBKP_AGE" 
    VOLSIZE=100 
    DUPL_PARAMS="$DUPL_PARAMS --volsize $VOLSIZE " 
    }}} 
    /etc/duply/offsite/exclude: 
    {{{ 
    /bin 
    /boot 
    /dev 
    /lib 
    /lib32 
    /lib64 
    /lost+found 
    /media 
    /mnt 
    /opt 
    /proc 
    /sbin 
    /srv 
    /sys 
    /tmp 
    /usr 
    /run 
    /selinux 
    - /var/lib/jenkins/backup 
    - /var/lib/jenkins/backup_old 
    - /var/lib/jenkins/indexes 
    - /var/lib/jenkins/uploaded 
    - /var/lib/jenkins/wiki/work 
    - /var/lib/jenkins/srtm-osm 
    - /var/lib/jenkins/srtm-proccess 
    - /var/lib/jenkins/workspace 
    + /var/lib/jenkins 
    + /var/lib/awstats/ 
    - /var/www/www-download/indexes 
    - /var/www/www-download/night-builds 
    - /var/www/www-download/php_errors.log 
    - /var/www/www-download/latest-night-build 
    + /var/www 
    - /var
    /home/zibrita 
    - /root/nobakcup 
    }}} 
    _do mysql dump before backup_ 
    /etc/duply/offsite/pre 
    {{{ 
    /usr/bin/mysqldump --all-databases -u root -p***** > /home/mysqldump_all.sql 
    }}} 
    /etc/cron.d/duply 
    lftp -u ***,**** ****.your-backup.de 
          

    It is good to backup /etc/duply/offsite/ somewhere, if the machine crashes, there is the info to retrieve encrypted files from the backup!

    Restoring

    To list the current backup sets on your remote backup path use the following command:

    duply offsite status

    To restore the whole ‘offsite’ backup to /tmp I'd use this command:

    duply offsite restore /tmp/restore

    To restore the lastest version of a file from my ‘offsite’ backup to /tmp I'd use this command:

    duply offsite fetch etc/myfile /tmp/restore

    To restore the version from 4 days ago of a file from my ‘offsite’ backup to /tmp I'd use this command:

    duply offsite fetch etc/myfile /tmp/restore 4D

    The combination of Duplicity and Duply is a very powerful solution for backups on non-trusted spaces. The setup is a piece of cake compared to other Linux based backup solutions.

    Back to top

    Using KML Files

    In GoogleEarth (GE) you can add you own Placemarks on the map and collect them into a folder. From GE you can save the folder in kml format. When you have a different format you can use QGIS or other opensource software to convert to KML format. Maybe you can convert it directly to osm. You may use any format containing your POIs, if you are able to convert it to osm format.

    Converting KML (or Other Formats) into osm Format

    To perform this task we need to use gpsbabel. It is very useful to convert waypoints, tracks, and routes between popular GPS receivers and mapping programs. The syntax is very simple, and GPS Babel has an interface to create the syntax for you:

    $ gpsbabel -i kml -f my_places.kml -o osm,tagnd="tourism:museum",​created_by -F my_places.osm

    The generated file is like this:

    <?xml version='1.0' encoding='UTF-8'?>
    <osm version='0.5' generator='GPSBabel-1.4.0'>
      <node id='-1' visible='true' lat='41.890121' lon='12.492265'>
        <tag k='name' v='place01'/>
        <tag k='note' v='place01'/>
        <tag k='tourism' v='museum'/>
      </node>
    <node id='-2' visible='true' lat='41.892241' lon='12.489031'>>
        <tag k='name' v='place02'/>
        <tag k='note' v='place02'/>
        <tag k='tourism' v='museum'/>
      </node>
    </osm>
          

    All points inside the kml file are converted into osm points, assigning them some properties like tourism category and museum type. The created_by= option with missing value means that the properties will be ignored. If your poi belongs to different categories, I suggest you create multiple osm files and create OsmAnd odf files and merge them together later with OsmAndMapCreator, or create multiple obf files.

    Converting OSM Format into OBF Format

    Now you are ready to perform the final step. The conversion will be done using OsmAndMapCreator. Download, unzip and run this program.

    • Deselect all choices except Build POI Index as shown:
    • Select the work dir (File/Specify working directory…)
    • Load my_places.osm (File/Select osm file…)

    If all is right you'll find My_places.obf into your workdir folder. Simply upload this file into your OsmAnd phone folder and you have done.

    Good luck!!!

    Back to top

    How to produce customized vector data

    It is possible to create a customized obf file with specific (own) vector data (hiking paths, speed cams, transport routes debug way info), and adjust the rendere to display it.

    OsmAndMapCreator can process only OSM files (osm-xml, bz2, pbf). However the set of tags can be custom. To specify what tags/values need to be indexed by Creator please download and change this file. OsmAndMapCreator has an option to use custom rendering_types.xml in the settings. Once file is created you can double check that data is present by utility binaryInspector with '-vmap' argument. This utility is packaged with OsmAndMapCreator.

    Once the .obf file is ready you can create custom rendering file to display missing attributes. There is a default rendering style which contains all information about rendering. It is good to have a look at it but it is very hard to open/edit it and understand. More convenient way to create your own rendering style is to create style that depends (inherits) default style. A good example of custom rendering style you can find here.

    Currently OsmAndMapCreator doesn't support relation tagging. So you need to manually copy all tags from relations (like route color) to way tags by script.

    Back to top

    Specification of OsmAnd's SQLite format

    The SQLIte format used in OsmAnd is based on the "BigPlanet" SQLite as supported by MOBAC. In OsmAnd we add a number of tables extending the format:

    Table Column Spec and Purpose
    "info" "url" URL template to download tiles with zoom - $1, x - $2 , y - $3
    "rule" Specific to OsmAnd: Mostly "" or "beanshell", used to evaluate URL template for downloading tiles.
    "tilenumbering" "" or "BigPlanet". If "BigPlanet", zoom will be inverted and calculated as z = 17 - zoom.
    "timeSupported" "yes" or "no". A tiles table with a "time" column indicates when each tile was retrieved.
    "expireminutes" Integer. Specifies if tiles shall expire after the given number of minutes. They would still be displayed, but also re-downloaded.
    "ellipsoid" Integer 0 or 1. 1 for Elliptic Mercator (Yandex tiles).
    "minzoom", "maxzoom" Respective integer. (Also inverted in case of BigPlanet.)
    "referer" As used for downloading.
    "tiles" "x", "y", "z" Indicates tile Mercator coordinates. Note that zoom could be inverted for the BigPlanet case.
    "image" Blob of image bytes.
    "time" Time stamp when image was downloaded.

    The class supporting this is SQLiteTileSource at or near https://github.com/osmandapp/Osmand/blob/master/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java#L33

    Back to top

    Custom_Rendering_How-To.htm