NOTE : In order to properly use this tutorial, copy all the files contained in the directory '/DOC/TUTORIAL' to your hard drive. You may also want to make a print out of this document for reference. 'F4' will make a hard copy of this entire document. USGS-OEMG Mapping Software Tutorial by Christine Cook and Russell A. Ambroziak, Ph.D. U.S. Geological Survey Office of Energy and Marine Geology National Center, Mail Stop 915 Reston VA 22092 Tel : 703-648-6481 Fax : 703-648-5464 TABLE OF CONTENTS Introduction.............................................Page 1 System Requirements......................................Page 1 Disclaimer...............................................Page 2 STEP 1 : Digitizing the Paper Map........................Page 3 Use of program DIGIT *****DIGITIZING HINTS*****......................Page 5 STEP 2 : Conversion from XY to Latitude/Longitude........Page 8 Use of program LATLON *****CONVERSION HINTS*****......................Page 9 STEP 3 : Conversion from ASCII files to BINARY files.....Page 11 Use of program REORDER STEP 4 : Creating the control file for programs MAPPER...Page 12 and LINEFIX Use a text editor STEP 5 : Editing the Linework............................Page 19 Use of program LINEFIX STEP 6 : Editing the colors and Coloring the Polygons....Page 20 Use of program MAPPER Description of MAPPER functions..........................Page 23 Quick Reference to Mouse-Driven MAPPER...................Page 26 MAPPER Options -- Mouse Driven...........................Page 27 Quick Reference to Keyboard driven MAPPER................Page 33 MAPPER Options -- Keyboard Driven........................Page 36 Description of LINEFIX functions.........................Page 39 Conclusion...............................................Page 40 Introduction This tutorial to the USGS-OEMG mapping software is designed to get you started on producing your own maps. For demonstration purposes, a digital map of South American topography is included and the following documentation walks you through all the steps that were necessary to produce a digitized product. The paper map, along with all the software, is included, so that you are able to go through the same process in order to learn the steps. The information contained within the {curly brackets} contains the commands I used in producing the South American topography. If you wish to look at what I have included, see [fig_01], [fig_02], and [fig_03]. If you are familiar with the programs and do not require the tutorial, I encourage you to read the information following HINTS or NOTE sections. They contain information I found out by trial and error and may save you a lot of time if you read them. To find this information, hit F2 and search for '*****'. System Requirements MAPPER and it's related suite of mapping software, are programs written for the IBM PC and compatible microcomputers. The 386 models are recommended for speed, but the programs will work on the 286 machines. Currently, DIGIT will only work with the GTCO four button 12" by 18" SketchMaster or Ultima digitizing tablets*. Other requirements : 640 kb RAM MS- or PC-DOS version 3.1 or later Microsoft MSCDEX version 2.1 or later hard disk drive with minimum 4 megs of free memory EGA/VGA graphics system with one of the following: TSENG 3000 or 4000 chip set (Orchid) or PARADISE VGA Professional Board or ATI VGA XL Wonderboard or TRIDENT Graphics card * Any use of trade, product, or firm names is for descriptive purposes only and does not imply endorsement by the U.S. government. Disclaimer Although this program has been used by the U.S. Geological Survey, no warranty, expressed or implied, is made by the USGS as to the accuracy and functioning of the program and related program material, nor shall the fact of distribution constitute any such warranty, and no responsibility is assumed by the USGS in connection therewith. STEP 1 : Digitizing the Paper Map Use of program DIGIT The map you're working with needs to fit within the digitizing tablet's active area. This can be accomplished by photo reducing or enlarging the map as necessary. It is possible to digitize the map in sections and then link the sections together in LINEFIX, or combine the many .RAW files into one .RAW file using a wordprocessor. Remember to give each section as many control points as possible. (This will become more meaningful to you as you proceed through the steps.) Once the map has been pos- istioned on the tablet, it cannot be moved until all the digitizing has been completed. Place the map with either North up or North to the right. Sometimes, it makes for easier digitizing if you outline the linework in blue or red, for example, before placing the map on the tablet. {For this demonstration, the map will fit North Up on the digitizing tablet.} Type 'DIGIT'. The following menu appears on the screen : /\ 1 = red / 1 \ 2 = orange / ENTER \ 3 = yellow / & \ 4 = green / \ SAME COLOR /\ 5 = d_green / 2 \ / 4 \ 6 = vd_green / \ / \ 7 = blue / \ / \ 8 = cyan \ CLOSE / \ END / 9 = d_cyan \ / 3 \ / 10 = d_gray \ / \ / 11 = m_gray \ / NEW \/ 12 = l_gray \ COLOR / 13 = white \ / 14 = l_buff \ / 15 = buff \/ l -- plot lines and make an '___.XYC' file -- north up L -- plot lines and make an '___.XYC' file -- north to right x -- exit program A schematic of the puck with the function of each puck button is given. There are 15 different colors that can be used (black is omitted) while digitizing. DIGIT asks for the placement of the map upon the tablet (l or L as described above). This is used by the program to ensure correct XY placement. It then asks if you wish to open a new file. Type 'y' if you are beginning the digitizing. If you are continuing from a previous session type 'n'. If YES : Enter the filename without the extension. You will then be asked to enter the control points. It is necessary to enter control (or registration) points with the correct lat/lon values in decimal degrees in order for LATLON to work later on. The more control points the better. Key in the lat/lon value for control point 1 and hit , then move the puck over the corresponding graticule point on the map and hit the (yellow) key on the puck. Key in the lat/lon value for control point 2 and hit . Move the puck over the corresponding graticule and hit (yellow) on the puck. Continue on and do as many as possible. When all the control points have been entered, type 'x' to exit this function of DIGIT. {Initially, type 'y'. For the output filename type 'south_am'. Next, enter the control points as written on the paper map. (NOTE: control points must be in decimal degrees, not in deg-min- -sec) For example, for point #1, type 10 -80 . Then move the puck to the corresponding graticule mark on the map and hit the (yellow) key. Then type in 10 -30 . Continue on until all six points have been entered. Finally type 'x' to quit this function.} If NO : A list of *.XYC files within the current directory appears. (DIGIT creates .XYC files. These are ASCII files and are described below.) Move the bar over the file of interest and hit . The existing linework will appear on the screen. Entering a color number and then add to the existing linework by continuing the digitizing. *****NOTE***** If you call up an existing file, all existing linework and that which you have just added will be placed in 'update.XYC'. Before re-running DIGIT, rename 'update.XYC' to .XYC using the following DOS command : ren update.xyc .xyc where is the name of the file you are working on. If you neglect to do this, when you re-run DIGIT, 'update.XYC' is wiped clean and all prior changes will be lost. DIGIT will not run 'update.XYC'. Next, you are prompted to enter the color number you desire as given in the main menu. Any number between 1 and 15 will allow you to begin digitizing. If, for example, you wish the coast to be in one file and all the geology in another, tag the coast with one color (i.e. color 1 which is red) and the geology with another (i.e. color 2 which is orange). These two can be separated later in a word processor or by using the /a option on program MAKERAW. To digitize, move the crosshair over the line on the map while hitting the (yellow) button frequently. You will see a line appear on the screen that looks like what you are tracing. When you are finished with that line hit the (green) button. To pick a new color, hit the (blue) button and type a new color number from 1 to 15. Typing '0' (zero) will kick you back to the main menu. {Choose color '1' for the coast and hit . Move the puck to the area of the coast you wish to start at and hit the (yellow) button often while moving along the coast-line. When you are finished with the coast, hit the (blue) button. Digitize the topography in color '2'. Again move the puck over the linework while hitting the (yellow) button often.} *****DIGITIZING HINTS***** Linework files can only contain 10,000 lines, but it is useful to work with files that contain no more than 9,000 as this gives you editing leeway to add lines later. To help the editing process later, it is a good idea to break up long lines by hitting the (green) button and then immediately hitting (yellow) twice. If you do not hit the yellow button twice, you will leave a tiny space between the lines which will have to be edited later. The first time the yellow button is hit tells the program you wish to begin a new line, the second time it is hit begins the digitizing. This keeps the linework in the .XYC files easier to manage and edit. While digitizing, do not think of the geological contact lines as defining individual polygons. Simply think of them as linework. That is, if two contact lines share a common arc, do not digitize that arc twice. This will save much editing time later. For example : 1) ÚÄÄÄÄÄÄÄ¿ ÚÄÄ¿ ÚÄÄÄÄÄÄÄÒÄÄ¿ This is not needed, ³ ³ + ³ ³ = ³ º ³ it entails ³ ÚÙ ÀÄÄÙ ³ ÚÐÄÄÙ digitizing the ÀÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÙ common arc twice. 2) ÚÄÄÄÄÄÄÄ¿ ÄÄÄ¿ ÚÄÄÄÄÄÄÄÂÄÄ¿ Do this which ³ ³ + ³ = ³ ³ ³ entails ³ ÚÙ ÄÄÄÙ ³ ÚÁÄÄÙ digitizing the ÀÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÙ common arc once Last, it is a good idea to digitize a small portion of your map as a test example and run it through LATLON. This way, you will check for proper conversion from XY to lat/lon on a small sample. If errors persist, it is better to have to redigitize only a part rather than the entire map. This step is essential for very large and complex maps. See STEP 2 which describes the con- version process. The .XYC files are ASCII flat files and therefore readable to the user. An example of an .XYC file is as follows : 10.0000 -80.0000 < this is the lat/lon entered > 6086 2262 < this is the corresponding xy point > 10.0000 -30.0000 12445 2337 -20.0000 -80.0000 6350 5957 -20.0000 -30.0000 12144 6102 -50.0000 -90.0000 6321 9838 -50.0000 -30.0000 11146 9782 * < this separates control points from linework > 1 < the attribute number which is the same as the > < color number you digitized the line with. > 16383 11414 16383 11417 16383 11411 16356 11418 15847 11428 12994 11489 12298 11482 11744 11471 8292 11475 7766 11467 7101 11450 6214 11442 3735 11324 3173 11290 2736 11281 2285 11271 165 11152 127 11153// < the '//' signifies the end of > < that vector. > 1 49 6872 91 6856 113 6824 128 6772 353 7024 417 7068 498 7134 550 7179 1733 7024 1799 7006 1840 6995 1870 6999 2452 6695 2393 6626 2357 6573 2343 6515 2418 6320 2445 6275// 1 2445 6275 2565 6287 2592 6322 2630 6356 3174 6459 3278 6413 3363 6370 3426 6332 3683 6172 3733 6133 3802 6076 3881 6051 4314 6296 4342 6267 4418 6214 4464 6178 4740 6037 4726 5991 4785 5974 4843 5961 4972 5512 5010 5488 5061 5464 5112 5434// The information above the '*' is the control points. The line information follows the '*'. The '1' is the attribute of the line following it. This attribute is the color you digitized the line with. For example, if you are digitizing bathymetry lines, you can change the attribute from the color number (1 to 15) to the depth number corresponding to that bathymetric line. In MAPPER, if you choose to mark a line (this is described further in the section entitled 'Description of MAPPER functions'), it is this attribute number which is plotted on the map. It would be more useful to the user to have the bathymetry depth plot rather than the color used in digitizing the linework. *****NOTE***** If the map is positioned on the digitizing tablet with North to the right and you inadvertently tell the computer it is placed North up by typing 'l' instead of 'L', then, instead of redigitizing the lines, run the program RIGHTXYC. This will rotate the lines to the 90 degrees to the left. The program control line is : RIGHTXYC This output can then be renamed and run through LATLON as outlined in STEP 2. STEP 2 : Conversion from XY to Latitude/Longitude Use of program LATLON When all the digitizing is complete, run LATLON. This will convert the .XYC file to a file containing latitude and longitude. The following main menu appears : m -- Mercator u -- Transverse Mercator o -- Oblique Mercator p -- Modified Plate Carree a -- Albers Equal-Area Conic l -- Lambert Conformal Conic b -- Bonne t -- Orthographic s -- Stereographic g -- Gnomonic V -- Vertical Perspective P -- Tilted Perspective L -- Lambert Azimuthal Equal-Area z -- Azimuthal Equidistant S -- Sinusoidal y -- polyconic Type the letter corresponding to the projection of the map. You then need to answer a few questions necessary for the conversion. If you do not know the correct answers, give your best guess. The latitudes and longitudes entered must be in decimal degrees, not degree-minute-second. A listing of this information appears, along with the constant values needed for the conversion. Hit then type in the of the .XYC file at the prompt to continue. A listing of the amount of error in the conversion is displayed as follows and is contained in the file '.txt' (in this case, 'south_am.txt') : Projection = 'Lambert Azimuthal Equal-Area' ('L') latitude of standard parallel = -24.000 longitude of central meridian = -60.000 x correction = 0.996251 (xcor) rotation = 0.678116 deg. (theta) scale = 0.89417 km/count or 35.7667 km/mm or 35766662:1 tablet root mean error = 0.151 mm earth root mean error = 5.387 km = 3.348 mi X0 = -8687.208 Y0 = -6275.232 ------------------------------------------------------------------------ input* output** errors (km) -- ------------------ ------------------- -------------------------- Lat Lon Lat Lon X Y Total -- -------- --------- --------- --------- ------- ------- ------- 1 10.0000 -80.0000 -> 9.9891 -79.9800: 2.184 -1.214 2.499 2 10.0000 -30.0000 -> 9.9840 -30.0316: -3.455 -1.773 3.883 3 -20.0000 -80.0000 -> -19.9281 -80.0261: -2.723 7.990 8.441 4 -20.0000 -30.0000 -> -20.0335 -30.0206: -2.147 -3.718 4.294 5 -50.0000 -90.0000 -> -50.0053 -90.0053: -0.377 -0.587 0.698 6 -50.0000 -30.0000 -> -49.9931 -29.8893: 7.909 0.766 7.946 ------------------------------------------------------------------------ * control point latitude and longitude coordinates ** computed from the corresponding x and y coordinates X and Y values from the '.xyc' file are corrected before converting to lat/lon for rotation (theta), directional stretching (xcor), translation (X0 and Y0), scale and for the fact that Y is down int the '.xyc' file. x = (X+X0)*xcor*cos(-theta)-(Y+Y0)*sin(-theta) y =-(X+X0)*xcor*sin(-theta)-(Y+Y0)*cos(-theta) X = x*cos(theta)/xcor-y*sin(theta)/xcor-X0 Y =-x*sin(theta)-y*cos(theta)-Y0 where: X = column of image or distance right on tablet Y = row of image or distance left on tablet X0 = right offset to projected map origin Y0 = down offset to projected map origin x = meters left on projected map y = meters up on projected map functions used to translate systems: int xy2ll(double x,double y,double *lat,double *lon,struct control cc) int ll2xy(double lat,double lon,double *x,double *y,struct control cc) *****CONVERSION HINTS***** There are a number of clues in the above information which tell you if the conversion is correct. The first number to look at is the 'table root mean error'. If this number is large (greater than 0.9) that indicates a problem with one or more of the control points. The ideal range for this number is from 0 (zero) to 0.5 mm. On average, you do not want to be more than 0.5 mm off of the graticule while digitizing the control points. Another number to look at is the scale. If you know the scale of the map you were digitizing from, you can compare that vale with the one determined by LATLON. If there is a marked difference, then there is a problem. 'Earth root mean error' is calculated from the scale and 'tablet root mean error'. In the above example this value is unacceptable large. The lat/lon comparisons is a final way to check the conversion. The first column shows the lat/lon values typed in while running DIGIT. The next column shows the calculated lat/lon values given the above 'tablet root mean error', scale, stretch and rotation values. The last column shows the X, Y, and TOTAL error of your linework. If the second column and the first column widely disagree then this also indicates a problem. Occasionally, only one or two control points may be off while the others are accurate. This deviation will show up in the last column. In the above example, control point 4 is quite accurate with a total error of only 1.781. The rest of the points, however, all contain large total errors. If the errors noted above are exceedingly great, check the control points; are the longitude positive when they should be negative? Does the lat/lon agree with the xy? Or perhaps you have entered the necessary information incorrectly. Another problem may be that one or more of the control points were not within the effective digitizing area of the tablet. If there exists one or two bad points they can be corrected by deleting those bad points and their corresponding XY from the .XYC file and then resaving the file as an ASCII flat file. Or perhaps you did not enter the correct projection or related projection information while using LATLON. Re-run LATLON and enter different information and try again until the error is within the desired accuracy. If, after checking the all possible areas, the error still remains exceedingly large, you may have to start over and redigitize the information taking care to be accurate. Last, you will be prompted to create a .RAW file. This file type is ASCII and is readable to the user. Type 'y' to create .RAW file. After the .RAW file is created, the main menu will again appear. An example of a converted .RAW file is as follows : 1 36.542213 -77.479012 36.550900 -77.849602 36.551899 -77.849503 36.543800 -78.248901 36.542801 -78.425400 36.542702 -78.577202 36.542999 -79.077301 36.542400 -79.231201 36.540600 -79.351700 36.545700 -79.842201 36.545300 -80.032600 36.544601 -80.194298 36.558998 -80.565201 36.563000 -80.685997 36.563000 -80.779800 36.568199 -81.161003 36.570801 -81.241402 36.574600 -81.332397// 1 37.312099 -81.382698 37.314999 -81.373703 37.320702 -81.369102 37.309299 -81.345001 37.296902 -81.328102 37.287300 -81.315903 37.249802 -81.258202 37.241199 -81.244499 37.232601 -81.231903 37.262001 -81.169296 37.267799 -81.147797 37.273399 -81.127998 37.293301 -81.016701 37.296700 -81.002403 37.298698 -80.993599 37.290100 -80.973000 37.292099 -80.957603 37.297100 -80.941498 37.328701 -80.884697 37.335701 -80.875504 37.340500 -80.867203// The control points no longer exist in the .RAW files but the attributes still remain and can be edited as easily as in the .XYC files (See STEP 1). The xy has been converted to lat/lon. When you are finished with LATLON, type 'x' to exit the program. {For our example, type 'L' for Lambert's Azimuthal Equal Area Projection. The Latitude of the Standard Parallel is -20 and the Longitude of the Central Meridian is -60. The filename is 'south_am' and you want to create a 'south_am.RAW' file (if the errors are acceptable). After this is complete, go into a text editor and separate the lines. Put the coast lines, those lines with the number 1 attribute, into a file called 'coast.raw' and put the rest, those lines with the attribute of 2, in a file called 'topo.raw'. Or, type MAKERAW south_am coast /a 1 This will put the lines with 1 as the attribute in the coast.RAW file. Do the same for the topo lines (MAKERAW south_am topo /a 2).} STEP 3 : Conversion from ASCII files to BINARY files Use of program REORDER MAPPER does not run on .RAW files. To convert the .RAW files to the binary files (.BIN, .HDR, and .ATR) that MAPPER needs, type in REORDER . You will then be given a list of options : c -- count segments in file (don't process) R -- reorder file and make binary file without dupes r -- reorder file and make binary file p -- same as 'r' but not in order Or type in the command line REORDER