LINUXUSER Xrmap

Viewing the world with Xrmap IM_VIEWER variable to reflect your choice. This also applies to the other configuration variables in this section. In our lab we noticed that launching some text editors from Xrmap caused a DIGITAL ATLAS few issues. For example, the Gvim editor just came up with empty pages. If you want to become an expert in world geography, why not get a little As the default tools are all excellent programs, you may prefer to keep them help from the CIA? BY ANDREAS KNEIB rather than modifying Imakefile. You can always set command line options to rmap is a handy tool that pro- the directory where you will be installing change the external tools later. vides access to a very interesting the Xrmap program components: The current Suse distribution includes Xcollection of data: the CIA Fact- Ghostview (gv), Timidity, and the Im- book. The Factbook [4] is a bundle of XCOMM U agemagic package, which includes Dis- details from the CIA’s extensive data- Install to /usr or /usr/local play. The only program that most distri- base. DESTDIR=/usr butions will be lacking is Dillo, the fast According to the project homepage, ; you may need to down- the vector maps show a total of 20,000 If you keep the default, parts of the soft- load Dillo off the web [2]. Incidentally, cities, along with airports, mountains, ware, such as manpages or binary files, the Emx editor is an Xrmap component. and observatories. This data is all avail- will be placed below /usr in the directory After modifying Imakefile to suit your able in the packed archive file. Xrmap is tree. requirements, and saving the file, give your window to this bundle of data, giv- Below the comment line XCOMM De- the xmkmf command, and then enter ing users quick access via a GUI that will fault external utilities, you will find the make to build the program. run on any X11 system. external tools that Xrmap uses to view After make has completed the build, HTML pages and Postscript files, or to you should see a message telling you Installing Xrmap play midi files: which external files the program needs. RPM and tar archives of Xrmap are avail- To be on the safe side, copy the text from able from the project homepage at [1]. If PS_VIEWER="gv -noantialias" the shell window into a text file; you you prefer to install from source code, IM_VIEWER="display U may need to refer to this output later. download the tarball, untar the archive -background gray84" But let’s concentrate on installing and change to the directory: HTML_VIEWER="dillo" Xrmap first. To do so, enter the su com- PRINT_CMD="lpr -Plp" mand to become root. Then run the tar xvjf Xrmap-2.33.tar.bz2 EDITOR="emx -fn 9x15" make -n install | less command to test cd Xrmap-2.33/ MIDIPLAYER="timidity -ig" if setup stores components such as the manpage in the specified directories. The next step is to edit the Imakefile file. If you prefer to use a different viewer If the test turns out to your satisfac- The variables in this file let you specify from the default display tool, modify the tion, become root and give the make in- www.sxc.hu

86 ISSUE 67 JUNE 2006 WWW. - MAGAZINE.COM Xrmap LINUXUSER

stall command. Time to turn our countries, cities, and re- attention to the data files output in the gions. You can also influ- message. The files include the com- ence the way airports, pressed map CIA_WDB2.jpd.bz2, the mountain peaks, observa- flags-2.5-eps.tar.bz2 tarball with the na- tories, or longitudes and tional flags, or the CIA factbook in latitudes are displayed. HTML format, titled factbook_html_ Keyboard shortcuts are 2005.tar.bz2. The message sorts these the quickest way to ac- files into the required, recommended, cess many parameters. and optional categories. The [I] tells you the You can download this material from names of cities; pressing the project’s ftp server at [4]. The files [A] shows you the air- range from 26MB to 476MB, so you ports and their names. To might like to base your decision on pop- view observatories, press ulating Xrmap on the bandwidth you the [B] key. Names of have available. countries and oceans are After completing the download, move displayed when you press the files to the share directory specified [L], and pressing [P] for by the SHAREDIR in Imakefile; this is peak shows you moun- Figure 1: The CIA Factbook gives users valuable information /usr/local/share/rmap in our example. tain peaks. about countries around the world. Then change directory to SHAREDIR, You can press a key to and unpack the compressed extensions: toggle the view through displaying a city, man xrmap at the command line, or displaying a city and its name, and hid- press the [H] for help key in Xrmap. cd /usr/local/share/rmap ing a city. The colon key [:] opens a top- You can simply pass command line for i in *.tar.bz2; U ographical map of the selected region. options to the tool instead of configuring do tar xvjf $i; done You are already familiar with the func- shortcuts and settings. For example, you tions that the right and middle mouse can tell the program to show +cities and Xrmap is now ready for use. buttons give you, so let’s talk about the +airports. To restrict the tool to a map left mouse button. When you hover the of Europe, you would specify -continent Cities, Countries, Rivers mouse over a city and press the left 3, and you can load the country files in Once you have navigated the Xrmap mouse button, the City & Country info- your editor by specifying -editor xedit. installation process, actually using the box appears. This box gives you useful To view the map for a specific loca- software is child’s play. Type xrmap in information on the city and the country tion, specify the parameters -latitude and a shell to launch the program. Xrmap that you highlighted. The window will -longitude, for example: xrmap -latitude comes up with a globe display. tell you all about the state in which the 52.520 -longitude 13.380 -zoom 10 Pressing the [+] key zooms in on a city is located, and also fill you in on the ++cities. map. The minus key [-] scales the visible state’s geographical characteristics and This example takes Xrmap to a map of selection, and the arrow keys let you population build-up. Berlin, Germany, scales the view tenfold move around the map. As an alternative, For airports, Xrmap gives you the air- (-zoom 10), and names the city (++ you can right click a field on the map; port code and the length of the runway. cities). You can pick any spot on Earth. the software will zoom this selection to For peaks, the program tells you which give you a closer view. mountain range they belong to, along Conclusion The middle mouse button opens a with the height of course. Although installing from the source code menu where you can choose a number No matter whether you select a city, a may seem difficult, and although many of options by clicking on the highlighted peak, an observatory, or an airport, the add-ons are not exactly lightweight, letters. As an example, the [O] key opens window next to it will give you details of Xrmap is a powerful, flexible, and sur- the editor for setting options. You can the country and six buttons. From left to prisingly simple tool for studying world then select File and then the External right, the buttons take you to country geography. ■ Programs parameter in the submenu. data, the CIA Factbook, the text of the You can now modify the tool you spec- national anthem, the tune of the na- INFO ified previously in the Imakefile. Clicking tional anthem, and the flag as a Post- [1] Xrmap page: the HTML browser box, and changing script, PDF, or graphics file. The last but- http:// frmas. free. fr/ li_1. htm#_Xrmap_ the text box from dillo to , will tell ton centers the image in the window. [2] Dillo web browser: Xrmap to use Mozilla Firefox for viewing As Xrmap knows at least 1,000 roads http:// www. dillo. org the HTML pages in the CIA Factbook. that lead to Rome, it also understands a [3] FTP server with add-on data: The options are quite extensive, cover- large number of command line parame- ftp:// ftp. ac-grenoble. fr/ ge/ ing topics ranging from printer configu- ters. The manpage gives users an over- geosciences/ xrmap/ data/ ration, maps you will be using, detailed view of the eighty or so options that you [4] CIA Factbook: http:// www. cia. gov/ cia/ color options, and search settings for can set in the shell. You can either run publications/ factbook

WWW.LINUX - MAGAZINE.COM ISSUE 67 JUNE 2006 87