Joe Thielen's 5 Minute Guide to using DrawMap for Linux


BACK


This is just a quick guide to compiling/using DrawMap for Linux. I wrote this so I could refer to it if I ever forgot :)

COMPILING DRAWMAP:
Compiling DrawMap was EASY for me. I'm using Linux-Mandrake 7.1. You need to make sure you've got GCC, G++, make, the GNU development libraries, and all that crap loaded (this all gets loaded if you do a FULL Linux install)!

  • First you need to download it from here.
  • Then 'gunzip' and 'untar' the file:
  • 'gunzip *.gz'
  • 'tar -xvf *.tar'
  • You should have a 'DrawMap-X' directory... where X is the version number. Go into that directory.
  • 'cd drawmap-X'
  • Finally, you need to compile the software using the 'make' command:
  • 'make'
  • OBTAINING USGS DATA:
    Before you can use DrawMap, you must obtain some USGS .DEM and .DLG files. For an example, I'm going to use the Peninsula Quad data (320 is the Ohio Quad number for Peninsula).
  • Peninsula .DEM file (ZIPPED) cl320de0017.dem (may or may not have .dem extension)
  • Peninsula .DLG file - Water (ZIPPED) cl320ohy (ohy=water) (may or may not have .dlg extension)
  • Peninsula .DLG file - Roads (ZIPPED) cl320ord (ord=road) (may or may not have .dlg extension)
  • Peninsula .DLG file - Rails (ZIPPED) cl320orr (orr=railroad) (may or may not have .dlg extension)
  • Get these files and unzip then all in a temp directory. Then copy the 'drawmap' executable file you just compiled to this temp directory.

    USING DRAWMAP ON A SINGLE USGS QUAD:
    OK, we've got the program, and we've got the data. To create an image, use the following command:

    drawmap -o normal.sun -d cl320de0017.dem cl320ohy cl320ord cl320orr

    This will create a file called 'normal.sun'. To view it, use The GIMP on Linux.

    Now, this file is pretty cool, but it doesn't get REALLY detailed. What if you wanted to LARGER, MORE DETAILED picture??? Try This:

    drawmap -o normal.sun -d cl320de0017.dem cl320ohy cl320ord cl320orr -x 1800 -y 1800

    This will specify a size of 1800x1800 pixels for the image. This makes a PRETTY LARGE IMAGE. But it's also VERY DETAILED.

    Again, you can use The GIMP to view the image. You can also save it to another (more standard) image format (such as .JPEG, .PNG, or .GIF... I was unable to save it as a .JPG for some reason, so I saved it as a .GIF).

    Sample images:

  • Normal .GIF (82K)
  • Large .GIF (680K)
  • USING DRAWMAP ON MULTIPLE USGS QUADS:
    This is a little bit more tricky. Only in the fact that you have to know the corner Lat/Lon before you begin.

    To do this, I used the USGS DRG (TOPO) maps that are provided. They clearly show the Lat/Lon in the four corners.

    What we're now going to do is make a combined map of the Peninsula Quad (whose data we already have), with the Northfield Quad (which the quad to the north of Peninsula... quad number 312):

  • Northfield .DEM file (ZIPPED) cl312de0017.dem (may or may not have .dem extension)
  • Northfield .DLG file - Water (ZIPPED) cl312ohy (may or may not have .dlg extension)
  • Northfield .DLG file - Roads (ZIPPED) cl312ord (may or may not have .dlg extension)
  • Northfield .DLG file - Rails (ZIPPED) cl312orr (may or may not have .dlg extension)
  • So take these files, and unzip them in the same directory as the Peninsula files.

    OK. Now you've got the files. The last thing you need to know is the coordinate range. This is the tricky part.

    What I did is I looked at the USGS DRG topo maps (these are in .TIF (TIFF) format). WARNING: BOTH OF THESE FILES ARE VERY VERY LARGE!

  • Peninsula DRG TOPO Map (ZIPPED) - (4.3M)
  • Northfield DRG TOPO Map (ZIPPED) - (3.7M)
  • OK. Take these files and unzip them. Now, on a piece of paper, draw two squares, one on top of the other.. kind of like this:

            1
     +-----+
     |NQ   |
     |     |
     +-----+
     |PQ   |
     |     |
     +-----+
    2
    

    Here we have 2 points -- 1 and 2. Now, normally, I would do the upper-left hand corner and the lower-right hand corner. I don't know why, but it's what I'd normally do. However, DrawMap didn't like this when I did it. But when I took the Lat/Lon from these two points (lower-left and upper-right), it worked perfect!!!

    So what you need to do is to view the Northfield quad .TIF file (again, using something like The GIMP). Go to the upper-right hand corner, and find the Lat/Lon coordinates. You should get:

  • Lat: North 41d 22m 30s (N 41 22' 30")
  • Lon: West 81d 30m (W 81 30')
  • Fine and dandy... except for one problem. DrawMap can't deal with minutes and seconds in coordinates, it needs straight degrees. No biggie. To get degrees, just take your seconds (if applicable) and divide them by 60. That will give you a decimal number. Then add that decimal to the minutes, and divide that again by 60 to give to another decimal. Add THAT Decimal to the degrees, and you've got it... so:

    Latitude: 41 22' 30"
    30 / 60 = .5
    22 + .5 = 22.5
    22.5 / 60 = .375
    41 + .375 = 41.375
    Lat: N41.375
    
    Longitude: 81 30'
    30 / 60 = .5
    81 + .5 = 81.5
    Lon: W81.5
    

    OK, almost done. Finally, North and East values are positive, while South and West values are negative:

    N41.375 = 41.375
    W81.5 = -81.5
    

    Now you've got ONE set of coordinates! On your piece of paper with the boxes, right these numbers doen in the '2' spot.

    Next, load up the Peninsula Quad, and get the coords from the lower-left hand corner of the quad. You should get:

  • Lat: North 41d 07m 30s (N 41 07' 30")
  • Lon: West 81d 37m 30s (W 81 37' 30")
  • So convert these values to straight degrees:

    Latitude: 41 07' 30"
    30 / 60 = .5
    7 + .5 = 7.5
    22.5 / 60 = .125
    41 + .125 = 41.125
    N41.125
    Lat: 41.125
    
    Longitude: 81 37' 30"
    30 / 60 = .5
    37 + .5 = 37.5
    37.5 / 60 = .625
    81 + .625 = 81.625
    W81.625
    Lon: -81.625
    
    Awesome!!! Now you've got two sets of coordinates. Take your piece of paper and write these new coords down in the '1' spot.

    It should now look like this:

            1 - 41.125,-81.625
     +-----+
     |NQ   |
     |     |
     +-----+
     |PQ   |
     |     |
     +-----+
    2 - 41.375,-81.5
    

    OK? Now we're ready to make magic with drawmap.

    In order to use more than one .DEM map we have to use multiple '-d' arguments. If you try and do this, you get an error that says you have to use the '-l' argument, and give it a range of Lat/Lon coords (lat1,lon1,lat2,lon2). No problem we just did that!!! So here is the command:

    drawmap -o np-normal.sun -l 41.125,-81.625,41.375,-81.5 -d cl312de0017.dem -d cl320de0017.dem cl320ohy cl312ohy.dlg cl320ord cl312ord.dlg cl320orr cl312orr.dlg

    That baby will produce you a combined map of Northfield & Peninsula Quads with roads, water, and railroads!!!

    Sample Image: np-normal.gif (6K)

    Now when you look at the map, you're not going to be impressed. It's VERY small. Let's make it BIGGER!

    I like to make my quads 1800x1800 in size. That gives you an EXCELLENT view. But we've got two quads, one on top of the other. So we know that the map we want to create will be 1800 pixels wide (x), and 3600 (1800 * 2) pixels high (y). So let's do this:

    drawmap -o np-large.sun -l 41.125,-81.625,41.375,-81.5 -d cl312de0017.dem -d cl320de0017.dem cl320ohy cl312ohy.dlg cl320ord cl312ord.dlg cl320orr cl312orr.dlg -x 1800 -y 3600

    This produces an EYE-POPPING 3D .SUN file which you can view with The GIMP, and save as a more standard image.

    Sample Image: np-large .GIF (1.2M)

    NEAT, EH? I think so. I think this can potentially have an AWESOME impact for GeoCachers, too!

    USING DRAWMAP ON A EVEN MORE USGS QUADS:
    OK, let's say you wanted to mesh a whole bunch of USGS QUADS together:

                        1
     +-----+-----+-----+
     |1    |2    |3    |
     |     |     |     |
     +-----+-----+-----+
     |4    |5    |5    |
     |     |     |     |
     +-----+-----+-----+
    2
    

    Just follow this map, and you should be all set! Use a command like this:

    drawmap -o file.sun -l lat1,lon1,lat2,lon2 -d 1.dem -d 2.dem -d 3.dem -d 4.dem -d 5.dem -d 6.dem 1ohy 2ohy 3ohy 4ohy 5ohy 6ohy 1ord 2ord 3ord 4ord 5ord 6ord 1orr 2orr 3orr 4orr 5orr 6orr -x 5400 -y 3600

    The '-x 5400' was derived from the formua: 1800 * 3 (there are three maps wide).
    The '-y 3600' was derived from the formua: 1800 * 2 (there are two maps high).


    NOTE: This document was written hastily in order to preserve my knowledge on how to use drawmap, since I forget alot :).
    I tried all the commands in here step-by-step, and they worked for me. If you have any problems, or discover any inaccuracies in this document, feel free to E-Mail me. I may not get back to you immediately, but I will get back to you!

    (C)Joe Thielen 2001
    Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.
    Created 05/25/2001 by Joe Thielen


    Questions? Comments? E-Mail me!
    HOME