Jack Cavanagh QBasic code to make APRS maps from USGS 100K:1 CD ROM. THis program can build city street level detail anywhere in the continental USA! As of APRS77c, the MK100k3.EXE no longer fits on the APRS distribution disk. You can download it from ARN BBS 410 280-2503 or get it vai ftp from tapr.org in the tapr/SIG/aprssig/files/upload area.
|Version 1.0||released 23 Oct 95|
|Version 2.0||Released 27 Dec 1995|
|Version 2a||Bug Fix 15 Jan 96 Fixed file name bugs|
|Version 3||Can make up to 676 (26 x 26) maps automatically!|
The extract program draws a map of the area covered by the CD. Use either the arrow keys or a mouse to select the "SELECT QUAD" option. Move the cursor to the region of interest and click or hit ENTER. The screen is redrawn with the selected Quad divided into 15 minute grids. Now pick "SELECT LAYERS". Normally, select only the hydrography and transportation. When you click END SELECTION, a "SELECT 15' GRID" option will become active. Select it. Move cursor to the regions of interest and click or hit ENTER. Pick grids (usually up to four) that contain the area you want. If your area is near a grid corner, four will be required to get the area. If your area is near the corner of two or more QUADS, this process may have to be repeated to get the four nearest 15' grids for his home town map. Once you have the grids, choose "OUTPUT" and give a path to the directory on the hard drive to store the data. (If the output only appears to take a few seconds, you probably need more conventional memory) Get more memmory and try again. Exit the program.
Now confirm the files were written in the designated directory. Remember the path to this directory. NOTHING BUT CD MAP FILES MUST BE IN THIS DIRECTORY. ANY OTHER FILE GUARANTEES A PROGRAM CRASH. There is no way to know in advance what file names will come from the CD. The program must try to process all files in the sub-directory. Please do NOT make any sub-sub-directory under the map file sub-directory either.
OTHERWISE, run MK100k3.EXE. The program first asks for the path to the data files. I use 'c:dlg'. Next you are asked if the files came from the CD or from the internet. This determines if the file is de-blocked or not. CD files are 82 byte records with a CR/LF while internet files are only 80 bytes long.
Next enter a 6 character filename for the output. An extension of .MAP will be added if the output is under the 3000 point APRSdos limit or .DAT otherwise. Next you are asked for the latitude and longitude of the center of the APRS map. Enter this information in degrees and minutes. The APRS cursor is a good tool for identifying LAT/LONG. Decimal parts of the minutes are allowed e.g. 38,56.5. Do this carefully. Your coordinates must fall within one of the 15 minute grids previously extracted in step one.
FInally, enter the map radius in nautical miles. This is actually one- half the North-South span of the map. The East-West span will be 4/3 times this value. The level of road detail is controlled by the value of your input. Interstate, U.S. Routes and major state routes will be extracted for all maps. Secondary state routes (Class 3) will be extracted once the radius falls below 8 miles. Class 4 roads, real local stuff, appear once the radius falls below 2 miles. You have some control over this. If the map radius is preceeded with a minus sign (-) then the default class of roads is decreased by one but not less than class 2. Use this in dense urban areas. If the map radius is preceeded with a plus sign (+) then the default class of roads is increased by one but not more than class 4. Use this technique in sparse rural areas to get more cross-road landmarks.
For the next 5 to 30 minutes the code will grind away. As map features are found they are plotted on the screen. A status line on the top shows progress in the form of the total number of lines in the data file, a rapidly changing number of lines examined thus far and the number of lines accumulated for the map. As each file is processed, the program start time and file finish time is updated. When all files have been processed, the code tries to link as many short segments as possible into longer segments. Progress is shown as the maps lines change color to white (temporarily). The results are reported on the screen as the number of line segments and map points. Finally at the stroke of a key the display will show the map as it would appear in APRS. Exit BASIC at this point and the default drive will contain two files with your file name and the extentions .dat and .map. The raw data file .dat can be reworked with the MAPFIX program to delete unwanted features and make a new .map file that fits APRS. There is also a file 'temp' which was used as a working file. This is over written each time the program is run.
These maps have limited river and stream information. They are on the CD but if there is no internal coding to distinguish between a short little stream and a signifcant river unless the river had two distinct banks on the original maps. Single line width rivers and streams are just not extracted. What we are left with is every little pond that has a "shoreline". If these are not significant to you edit them out with MAPFIX command "Kill feature". The line attributes on the CD do not distinguish between coast lines, river banks or lake shorelines. All are colored in dim cyan.
MK100K3 makes your map radius about 5% larger than the integer APRS scales of 1, 2, 4, 8, etc nautical miles. This is so that APRS will load the map at the indicated range with out a PERFECT placement of the cursor at the center.
The USGS Data User's Guide implies that political boundary and public land survey data is on the CD. This is not the case for the optional format CD. If city or county lines are significant to you, import them with MAPFIX from a map made from the 2,000,000:1 CD.
Some users have reported problems with no maps being produced. This appears to caused by a user map center and radius that does not fall within the region covered by the files. The already verbose error message has been expanded to reveal records 11 through 14 of the last file examined. These records define the four corners of the map data which can be compared with your input values to see were the mistake was made. It will be either a wrong map center or a bad choice of files.
MK100k3 halves the number of points extracted for shorelines as a brute force reduction technique. Also some shorelines are so long, that MK100k3 can not find the beginnning or end in the data. If such a line is omitted though, it is usually very noticable.
- I am still wary of how this code will perform in regions with extensive shorelines such as tidewater Virginia or Lousiana bayous. I need user feedback on this.
- If there is an overwhelming need for railroads, canals, trails, etc, a switch could be added.
Remember the map data is based on 15 minute USGS maps, although 7.5 minute maps may have been digitized. The maps extend 15 nautical miles north-south everywhere. The east-west extent depends on latitude. For the continental United States, this can range between about 12.6 nautical miles for the Florida Keys down to about 9.8 nautical miles for International Falls, MN. An APRS map is 4/3 as wide as it is tall. Thus a 1 radius mile APRS map covers 2 nautical miles north-south and about 2.67 nautical miles east-west. My point here is that even a one mile map could require extracting data from as many as 4 each of the transportation and hydrography map files and typically require two sets of these map files.
WB4APR COMMENT. Due to the TALL 15 minute box of raw data, and the FAT wide APRS display format, I use the following extraction method so that I can make the optimum coverage APRS map for a given 15 minute area as follows:
* * * * * * * Two 4.2 mile maps but ONLY if the area is very sparse * * * * ----------+---------- Eight 2.1 mile maps * - - - - - * | | | should cover most mid USA * * | | | latitudes quite well * * +--------(*)--------+ * * * * * * * | | | | | | +---------+---------+ | | | | | | +--------(*)--------+ | | | | | | ----------+----------I get these 8 maps by just selecting Jack's 4 map option twice, once for the upper center of the 15 min cell, and again for the bottom center
This is an upgrade to MK100k2a.EXE with requested changes by WA4APR, KE4EER and W7KKE. Solved the file name problem caused by the different ways DOS and BASIC handle the "null" character and a bug in file pointers if you did not use a six character name. If you use less than six character names on multiple map files, it will now work! The intermediate data are now stored in a file "tmap.raw" before the short segments are chained together to avoid conflicts with TEMP directories. Ram drive: If you set up a ram drive, you can use it for tmap.raw to save mechanical wear-n-tear. To use the ram drive, start the program with the command:
mk100k3 d:where "d" is the drive letter of your ram drive created with ramdrive.sys in your config.sys. NOTE: This will probably cause the drive letter for your CD or zip or jaz drive to change. Be forewarned! To set up a ram drive from DOS add the following to your config.sys file:
devicehigh=c:dosramdrive.sys 128 /EThis will set a 128K ram drive in extended memory. This is big enough for tmap.raw. Consult the DOS on-line help files if you want to use expanded memory or want a bigger ram drive. If you use Win95 use the following instead in config.sys:
devicehigh=c:windowsramdrive.sys 128 /EI have made sure that the last line in the output file contains "0,-1" The user now can get small road detail down to tracks and jeep trails. If you follow your maps radius value with an exclamation mark (!) you will get any and all data on the CD files including railroads, pipelines, etc. (if you extracted the data from the CD). You will also get every little stream and water filled ditch. Try this in an urban area and you will be running MAPFIX all night.
The program does not stop any more if there was no data to be found. It continues on until all possible maps for the current grid have been made or not made. A log files is written telling you the size of successful map builds in APRS map points and shows maps for which no data could be found in the files extracted from the CD to your hard disk. The log file has the name "filename.txt". "Filename" is what you typed in at the beginning of the mapping session.
The number of pixels per degree has been doubled to better match the scales used in APRS.
Oops! key. Hitting F10 will stop the program while making maps. This saves having to reboot if you realize that you made an input error.
Win95 and all that. This code was written in Microsoft QBasic 4.5 and the compiled .exe files will run under DOS, Windows 3.1 and Win 95. Win 95 opens mk100k3.exe with a small window, but this can be permanently fixed to a full size screen with the "properties" selection accessible with the right mouse button. You're on your own.
Comments, bugs and suggestions are welcome. Contact me by packet at firstname.lastname@example.org on packet or 223 N. Randolph Rd., Falmouth, VA 22405 by snail mail. I will be on the Internet in a few months.
Happy mapmaking and APRS operating, Jack, KB4XF
Jack Cavanagh, KB4XF Falmouth, VA email@example.com