Drawmap Version 4.0 A program for drawing representations of the Earth's surface. by Bryan Brown 01/18/92 I. Abstract This program gives the user the ability to generate representations of the Earth's surface, using the full Micro World Data Bank files. Representations such as a Mercator projection, hemispherical views, and orbital views can be generated. The user has full control over which items to draw (e.g., coastlines, rivers, etc.), as well as the detail level at which to draw the items. The user also has full control of the 16-color palette, with user specified colors for flood fills, line drawing, text, and for the individual map items. Screens can be printed or saved to disk as standard IFF files. A fully user-configurable online help facility is also provided. II. Disclaimer As with version 3.1, no guarantee is made as to the accuracy of the national boundaries represented by this product. Recent political events have made the map file out of date. III. Distribution As with version 1.0 (on Fish disk 229), Version 2.0 (on Fish disk 315), Version 2.24d (on Fish disk 485), and version 3.1 (on Fish disk 545), this program is released into the public domain (FREEWARE), and is freely distributable as long as this document file, source code, header files, binary files, IFF file and text files are included in their entirety. The source may be modified for personal use, but is NOT for commercial use. The program was originally developed with Aztec C version 3.6a. The enhancements that lead to Version 2.24 were compiled with the SAS (Lattice) C compiler V5.10. The modifications resulting in version 3.1 were compiled with Aztec C version 3.6a. Version 4.0 was generated with Aztec C version 5.2a. Files included: drawmap4.0 - executable code drawmap4.0.info - icon file for workbench users drawmap4.0.020 - executable code requiring at least a 68020 CPU and 68881 FPU drawmap4.0.020.info - icon file for workbench users drawmap4.0.doc - documentation file drawmap4.0.doc.info - icon file for workbench users drawmap.c - source code drawmap.h - general header file drawmap-help.h - header file for help option drawmap-menu.h - header file for menu selections drawmap-proto.h - header file with function prototypes drawmap-req.h - header file for string requester reqglue.asm - glue file for accessing req.library (from Fish disk 419, where the object file is named areqglue.o) reqbase.h - header file for accessing req.library (from Fish disk 419) ILBM_lib.h - header file for accessing ilbm.library (from Fish disk 463) IlbmInterface.asm - interface file for accessing ilbm.library (from Fish disk 463) coast.pnt - map file with coastlines (74967 points) country.pnt - map file with country outlines (22359 points) island.pnt - map file with island outlines (35171 points) lake.pnt - map file with lake outlines (15118 points) river.pnt - map file with rivers (28194 points) state.pnt - map file with U.S. state outlines (2259 points) map.config - configuration file containing user palette map.limits.bin - auxiliary file containing max and min values of latitude and longitude for each arc in map files map.flat.pic - IFF file containing a flat map for initial display drawmap.help - simple text file containing help information for each menu item req.library - library for general requesters (from Fish disk 419) ilbm.library - library for saving IFF pictures (from Fish disk 463) make4.0 - simple batch file for building the executable code Reqlibrary.lzh - compressed version of Reqlibrary materials from Fish disk 419 ilbm.lzh - compressed version of ILBMLibrary materials from Fish disk 463 InstallLibs - simple batch file for installing req.library and ilbm.library into the user's LIBS: directory InstallLibs.info - icon file for workbench users IV. Differences from version 3.1 o Requires 1.5 megabytes of memory. All map files are preloaded into memory for speed. o Runs only from a hard disk with at least 1.6 megabytes of space to hold the source, executable, and map files. (Sorry, floppy-disk users, but I have only one 3.5" floppy disk drive, with no way to check any other configuration.) o Uses the full Micro World Data Bank data files, with separate files for the coastlines, countries, islands, lakes, rivers and U.S. states. o User selection of items to be included, the detail level and the color in which to draw each item. Coastlines, rivers, etc., can be different colors to more easily distinguish between the items. o Trig files have been removed to reduce the memory requirements. Trig functions are now computed instead of being retrieved from a pre-built buffer. o Source now uses a "point" data structure instead of merely indexing into a contiguous buffer, making the source easier to read. o Fixed a bug in the box-selection and text-movement functions, in which the rubber-banded boxes did not appear when running under AmigaDos 2.04. o Compiled with Aztec C version 5.2a. V. Notes: o To run the program, your LIBS: directory must contain the files req.library and ilbm.library mentioned above. The simple batch file InstallLibs provided will copy these files into your LIBS: directory. o To actually run drawmap4.0 or drawmap4.0.020, all the following files must reside in the same directory: drawmap4.0 (or drawmap4.0.020) drawmap4.0.info (or drawmap4.0.020.info) coast.pnt country.pnt island.pnt lake.pnt river.pnt state.pnt map.config map.limits.bin map.flat.pic drawmap.help o The online Help facility contains a somewhat detailed description of each menu selection. o To build the program from source, the user will first have to assemble the files reqglue.asm and ILBMInterface.asm to generate areqglue.o and ilbminterface.o, respectively. The batch file "make4.0" may then be executed to build the actual executable program. (The reqglue object file is named "areqglue.o" instead of "reqglue.o" to signify that the file is for Aztec C, and not SAS (Lattice) C. On Fish disk 463 the SAS (Lattice) object file is named "lreqglue.o".) o For those users (including myself) who prefer pop-up menus to the standard Amiga menus, try the pop-up menu system on Fish disk 422. This background program (apparently) works with any normal program that uses standard Amiga menus. o The sheer size of the new map files unavoidably results in slower drawing of the maps. Even the auxiliary file (with suffix "trig.bin") in previous releases had to be discarded to reduce the memory requirements. As with version 3.1, the national boundaries in the map file "country.pnt" do NOT reflect the current changing political situation. o Unlike in version 3.1, no attempt was made to fill in any gaps in the item boundaries. The map files were obtained on five MS-DOS disks from The Software Labs in Intel (low/high byte order) and converted to Motorola format (high/low byte order) for use on the Amiga. This is the only modification made to the map files. o The text for each help entry may be modified by the user using any normal text editor. Note that the Help entries MUST remain in the original order, or else the help text will not match the Help gadget name. Each entry in the help file MUST remain delimited by a form feed character (12 hexadecimal). At program startup the program reads the help file into memory and looks for the formfeed character, replacing it with 0 hexadecimal (the normal end-of-string character in C). The help display option needs this end-of-string character to function properly. o The file "map.limits.bin" (which is used to speed up drawing the spherical and box views) contains upper and lower bounds on the information in each of the 1263 arcs in the map files. If this file cannot be found at program startup, it is built from scratch, and an attempt is made to save the file to disk. Whether or not the save is successful, the program continues. VI. Limitations o Because of limitations in the req.library and ilbm.library, the mouse pointers in the file requester, palette and Help item display windows revert to the user's own mouse pointer image rather than the arrowhead used in drawmap. It would be beneficial if the programmer were able to specify to req.library and ilbm.library the imagery to use for the mouse pointer. VII. Suggestions for further improvements (any volunteers?) o More kinds of maps (naturally). o Modify the source code to execute from multiple floppy disk drives instead of only from a hard disk. o For users with small amounts of RAM, do not preload the map files into memory. Read each map file a point at a time as necessary. This would result in slower execution than the current method, but at least the program would be usable by more Amiga users. VIII. Acknowledgments As stated earlier, these map files were obtained on five MS-DOS disks from The Software Labs (3767 Overland Avenue #112, Los Angeles, CA 90034). These files were put into the public domain by Fred Pospeschil and Antonio Riveria, based on original coordinate data generated by the Central Intelligence Agency. IX. Correspondence This program was originally developed by: Bryan Brown 13129 Collingwood Terrace Silver Spring, MD 20904, USA Enhancements for version 2.4 were written by: Ulrich Denker Nienort 46 4500 Osnabrück, GERMANY Modifications for versions 3.1 and 4.0 were written by Bryan Brown.