# Importing OpenStreetMapTM into YAAC

YAAC has been deliberately designed to not use external map servers. Considering the amateur radio operator's legal and moral obligation to provide emergency communications (in the United States, it's FCC regulations Part 97, paragraph §1(a)), a good APRS application should be able to function solely over amateur radio communications, not requiring the Internet or any commercial services only available over the Internet; though Internet-based services can be used, they cannot be mandatory for the functioning of a good APRS client application.

So, YAAC is designed to use locally-loaded map data. YAAC currently supports the OpenStreetMap database, downloadable from http://planet.openstreetmap.org and its mirror websites and bit torrents, both in total and in segments. For efficiency in rendering the map data, YAAC compiles the bulky and inefficient OpenStreetMap XML data into a compact and edited-down format specific to YAAC and optimized for real-time local map rendering. This compilation is done with the File->OpenStreetMap->Import RAW OSM Map XML File menu choice.

Because compiling large portions of the world map data to YAAC binary format can take considerable time (possibly literally days of processing time), a short-cut has been provided to copy already-compiled map data from the YAAC author's website. This option is available through the File->OpenStreetMap->Download Pre-Imported Tiles menu choice, and selects downloading the map data for a specified area around the area you are currently viewing.

## Prerequisites:

If you are going to import the OpenStreetMap data yourself, first you must obtain a copy of the OpenStreetMap dataset in bzip2'd XML format (filetype ".osm.bz2") from the OpenStreetMap website or one of its mirrors or torrents; PBF format is not currently supported. Note that the complete planetary dataset (as of October 2016) is over 53GB of size in bzipped format, so expect it to take a long time to download; alternatively, use a subset datafile (pre-segmented by one of the mirror websites) appropriate to the geographical area you are interested in. To assist you in finding the websites with OpenStreetMap data, the File->OpenStreetMap->Download OpenStreetMap Extract Dataset menu choice is available to steer your web browser to some of the OpenStreetMap websites.

Secondly, you need a system with YAAC installed and at least 66GB of free disk space after downloading the OSM dataset (assuming the full planetary dataset; smaller sets will still need at least 36GB), to buffer the temporary files used to geographically segment the OSM dataset into tiled subsets that are efficient to scan through for rendering. At the present OSM dataset size, 40 GB of this will be recyclable after the import completes. Also, you will need to run YAAC with a non-default larger memory heap size of at least 900MB (so your computer will need at least 2GB of RAM to perform well). Note that you can copy the compiled map data (or tiles thereof) to other smaller computers after the compilation is completed, as long as they are running the same version of YAAC. Note that different releases of YAAC may change the compiled format in incompatible ways; to correct such problems, simply re-import the map data.

## Compiling the map data

Ensure that your installation of YAAC is configured to place the tile directory in a disk partition that meets the above prerequisites for free space. Then select the File menu. OpenStreetMap submenu, and the Import Raw OSM Map XML File menu choice. This will display a file selection dialog:

Select the OpenStreetMap dataset file (in compressed OSM XML format) that you wish to import. Then, adjust the import bounding box settings for the rectangular portion of the planet you wish to extract from the OSM file; this allows you to not waste disk space and considerable processing time compiling parts of the OSM data that you will never use. Then click the Open button to begin the import.

A progress dialog will now be displayed. You may continue to use YAAC normally while the import is proceeding. Note that the import will take several hours (at least 4 hours, possibly as long as 2 days for the entire planet, depending on your CPU and disk drive performance and how much of the planet you are reading), so do not turn off your computer, click the Cancel button on the progress dialog, or stop running YAAC while the import is in progress. We suggest that you leave it running overnight, so that you will have your map data ready when you return to your computer in the morning. When the import is completed, the progress dialog will automatically close. At this point, any pan or zoom of the map display will cause rendering of the street map data for display in the background (assuming map display has not been disabled by the Select Geographical Map Layers menu choice).