packages icon

Some notes on drawmap.  Updated on January 15, 1999.

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 four executables, drawmap, llsearch, block_opt,
and block_std, along with associated manual pages for llsearch and
drawmap.  (Block_opt and block_std are utilities to add newlines to
DLG files.  They have no manual pages, and most users will probably never
use them.)  Install things wherever you want.  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 dubious about
the copyright status of a map generated by drawmap, since anyone else
can generate the same map using the same data, but it was easy to add
in, so I did.

Second, how to use it.  You need some data.  Some Web sites that have
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.

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, 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.  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 fairly easy 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.  Your mileage may vary.

I have a to-do list of things that would be nice to have.  At 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 slapped 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 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.

It might also be interesting to get drawmap to read the new Spacial
Data Transfer System (SDTS) format, and to adapt to files at any
spacial resolution.

It would also be a good idea to try to make the thing portable.  At
present, it has only been compiled under Linux.  Based on past
experience, I assume that it will readily port to other Unix systems.
However, porting it to DOS/Windows might not be fun.  I may fire up
my Borland compiler one of these days and give it a try.

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 to go out and buy Motif, or compile some
large support package, before I can use the software.

A caveat:  The 250K Digital Elevation Model (DEM) files and 100K
Digital Line Graph (DLG) files are limited in resolution.  If you
are expecting to duplicate the detail in a 7.5 minute topographic
map, you will probably be disappointed.  On the other hand, if you
happen to get hold of data sets with better resolution, you can
probably modify drawmap to handle them without much trouble.

If you do want 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.

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.  The output from drawmap is not guaranteed
to be correct, nor is it guaranteed to be even approximately correct.
Drawmap is provided "as is", with no express or implied warranty of
any kind.

Fred M. Erickson
603 15th Street
Havre, MT  59501-5339

fme@ttc-cmc.net