Some notes on drawmap. Updated on August 2, 2001. First, how to build it. Edit the Makefile if you want a copyright notice on all of the maps you generate. Then, simply type: make If you aren't on a Linux(TM) system, or similar Unix(TM) system, you will probably end up giving up and deleting the whole mess. Otherwise, you should end up with eight executables: drawmap, llsearch, ll2utm, utm2ll, block_dem, block_dlg, sdts2dem, and sdts2dlg. There should also be eight formatted manual pages, whose file names end with a ".1" extension; and eight unformatted manual pages, whose file names end with a ".1n" extension. Install things wherever you want. On my system, the executables go into /usr/local/bin, the manual pages with a ".1" extension get compressed (with gzip) and go into /usr/local/man/cat1, and the manual pages with a ".1n" extension get compressed (with gzip) and go into /usr/local/man/man1. (You don't have to install both the ".1" and ".1n" versions if you don't want to. The ".1n" version is probably the most useful, since it allows you to reformat the manual pages into various output formats.) I have resisted the urge to hard-code any pathnames, library locations, and what-have-you into the code. There is one compile-time option you can invoke by editing the Makefile. If you provide your name, it will be compiled into the program, and a copyright notice, with your name in it, will be added to the bottom of each map you generate. I am unsure about the copyright status of a map generated by drawmap, since anyone else can generate the same map using the same data, but the feature was easy to add in, so I did. Second, how to use it. You need some data. Once you have at least one Digital Elevation Model (DEM) file, using drawmap is as simple as typing: drawmap -d name_of_your_dem_file The output will be in a file called "drawmap.sun" and you should be able to view it with image viewers like "xv" and "ImageMagick". Sources of downloadable data are listed in the manual page. There is a lot of useful information in the manual page; you might want to give it a read. In particular, there are some usage examples near the end of the page. Drawmap grew out of my curiosity regarding what could be done with the available USGS data files. It was originally intended just to play with Digital Elevation Model (DEM) files. Later I added processing for Digital Line Graph (DLG) files, GTOPO30 files, and Geographic Names Information System (GNIS) files. Because of this history as an experimental testbed, drawmap was never actually designed. Instead, it grew by accretion, with major sections being reworked from time to time as I decided to try new approaches. There have even been a couple of top-to-bottom reworks, as I found it desirable to try a much different approach to one thing or another. The addition of support for SDTS files considerably increased the complexity of the program. Thus, if you are looking for elegant structure and logical design, you may be disappointed. On the flip side, it is copiously commented, and you should find it reasonably straightforward to modify. Keeping straight all of the various translations and rotations of data can be mind-numbing; but that pretty much goes with the territory when you work on a program like this. Also, in order to minimize its memory footprint, drawmap uses malloc() to get the space it needs, and then uses pointers to access it. I find the resulting code much more difficult to work with than code that simply allocates a 2-dimensional array and uses two index values to access the data. Thus, if I plan to do a major rework on the code, I sometimes convert it back to using arrays, do what needs doing, and then convert it to using pointers. Some people prefer to define macros that simulate arrays on the one-dimensional malloc() memory. Others may prefer to define C++ objects to hide all of the messy details. I like simplicity. Your mileage may vary. I have a to-do list of things that would be nice to have. Near the top of the list is to improve the handling of text. The routine that adds text annotations to the image is very crude. I cobbled it together one night because I needed the capability to add cursors and text in order to test out some algorithms, and I have never gone back to improve it. Only two bitmapped fonts are available, and they can only be printed horizontally. It would be super cool (and perhaps even swell) to have a bigger set of prettier fonts that could be scaled and rotated. This would be particularly nice for plotting hypsographic contour lines with the traditional elevation numbers printed along selected contours. (Although trying to do that sort of thing automatically would be a challenging task, indeed.) It would also be a good idea to try to make the thing portable. At present, it has only been compiled (by me) under Linux. Based on past experience, I assume that it will readily port to other Unix systems. However, porting it to Windows(TM) might not be fun. Another possibility would be to re-write it to be an X-Window application. This would allow some interactive features to be added and would also provide instant access to a large set of fonts and drawing primitives. However, there are already systems like that available, and I am not sure I want to produce yet another big, clunky, non-portable thingamabob that nobody uses because they can't get the thing to compile on their machines. I know how disappointed I am when I go to the trouble to download something, and then find out I need some large support package before I can use the software. If you like the kind of resolution available in a 7.5-minute topographic map, you might want to look into the availability of DRG files. DRG files are scanned-in versions of the standard USGS 7.5-minute map sheets. The USGS sells these files on CD-ROM, but they are also available on-line for some locales. For example, the state of Montana has a server providing all of the available DRG files for Montana. In fact, a number of states provide such a service. There are also a few sites that aren't tied to particular states, but have a smorgasbord of files from various locations. DRG files have no connection to drawmap. I mention them here simply because you might find them of interest. I hope you find drawmap both useful and fun. Remember though, that it is basically an experimental testbed, and not a commercial product. Use it at your own risk. Drawmap, and all associated software and documentation, are provided "as is", and are licensed under the GNU General Public License. See the file "COPYING" for license details. Fred M. Erickson 603 15th Street Havre, MT 59501-5339 fme@ttc-cmc.net