home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 24 / CD_ASCQ_24_0995.iso / vrac / aprs72a.zip / MAKEMAP1.BAS < prev    next >
BASIC Source File  |  1995-06-09  |  18KB  |  473 lines

  1. DECLARE SUB HELP ()
  2. DECLARE SUB init (mapf AS STRING, datf AS STRING, fldr AS STRING)
  3. DECLARE SUB fbook (finx%, f AS STRING, fldr AS STRING, bcolor%, suffix AS STRING)
  4. DECLARE SUB test (rcno&, rstop&, testflg%, finx%, attrb%)
  5. DECLARE SUB redraw (cmaxrec&, datf AS STRING)
  6.  
  7. ' Code to make APRS maps from USGS dlg CD
  8. ' Version 0.05  30 May 94 - KB4XF Jack Cavanagh, of Fredericksburg, VA
  9. ' Modified by APR on 3 May 1995 to add some explaination text to tell users
  10. ' to keep maps small (40 miles or so).  This plus increasing the max number of pts
  11. ' up to 6000 minimizes the number of TRUNCATED points
  12. ' Also put in test to prevent x=0 points....
  13. ' June 1,95 MAKEMAP1 increases PPD by a factor of 3 to get better resolution
  14. ' June 9, Added SKIPPT to skip every other pt in WB,ST,PB,AB and force % 2
  15.  
  16. DEFSTR A-Z
  17. COMMON SHARED lat0!, long0!, latmax!, longmax!, ppdy!, ppdx!
  18. COMMON SHARED latmin!, longmin!, version$, ALLpts%, Hfac!
  19. version$ = "Version 1.1"
  20. CALL init(mapf, datf, fldr)
  21. npts& = 1
  22. finx% = 1
  23. nseg% = 0
  24. oldx! = 999
  25. oldy! = 999
  26. PRINT
  27. PRINT "The CD ROM contains 7 major categories of map features as follows:"
  28. PRINT
  29. PRINT "  1  ROADS                - Included in all APRS maps"
  30. PRINT "  2  Water Boundaries     - Lots of points along coastlines"
  31. PRINT "  3  Rivers and Streams   - Lots of points."
  32. PRINT "  4  Political Boundaries - County lines.  Lots of points"
  33. PRINT "  5  Administrative       - Park and military boarders"
  34. PRINT "  6  Cultural features    - Airports"
  35. PRINT "  7  Railroads            - Railroads"
  36. PRINT
  37. PRINT "As a minimum, MAKEMAPS will always use categories 1 and 2, and additional"
  38. PRINT "categories up to the final category you select."
  39. PRINT
  40. INPUT "Select the maximum number of categories (7)"; a$
  41. IF a$ = "" THEN a! = 8 ELSE a! = 1 + VAL(a$)
  42. IF a! < 3 THEN a! = 3
  43. IF a! > 8 THEN a! = 8
  44. CLS
  45. ON ERROR GOTO Errortrap
  46. WHILE finx% < a!
  47. Again: Fault% = 0
  48.   CALL fbook(finx%, f, fldr, bcolor%, suffix)
  49.   OPEN f FOR RANDOM AS #1 LEN = 20
  50.   IF Fault% = 75 THEN finx% = finx% + 1: GOTO Again
  51.   labnr% = 0
  52.   minrec% = 1000
  53.   maxrec% = 0
  54.   rcno& = 1
  55.   startflg% = -1
  56.   tstart = TIME$
  57.   FIELD #1, 7 AS lno, 2 AS atc, 6 AS np, 5 AS att
  58.   DO WHILE NOT EOF(1)
  59.     LOCATE 1, 1
  60.     PRINT suffix; rcno&
  61.     GET 1, rcno&
  62.     nrec% = VAL(np)
  63.     aatc% = VAL(atc)
  64.     aatt% = VAL(att) - 29000
  65.     IF aatt% < 0 THEN aatt% = 0
  66.     attrb% = 100 * aatt% + aatc%
  67.     rstop& = rcno& + nrec%
  68.     rcno& = rcno& + 1
  69.     FIELD #1, 2 AS lad, 2 AS lam, 3 AS las, 3 AS lod, 2 AS lom, 2 AS los, 6 AS d$
  70.     CALL test(rcno&, rstop&, testflg%, finx%, attrb%)
  71.     LOCATE 1, 1
  72.     PRINT SPACE$(12);
  73.     IF testflg% THEN
  74.       IF nrec% < minrec% AND nrec% <> 0 THEN minrec% = nrec%
  75.       IF nrec% > maxrec% THEN maxrec% = nrec%
  76.       DO WHILE rcno& <= rstop&
  77.         GET 1, rcno&
  78.         alat! = VAL(lad) + VAL(lam) / 60 + VAL(las) / 3600
  79.         along! = VAL(lod) + VAL(lom) / 60 + VAL(los) / 3600
  80.         REM Test to see if this point is on map
  81.         LOCATE 1, 1
  82.         REM PRINT alat!; along!; aatc%;
  83.         OK% = 0
  84.         IF (alat! <= latmax!) AND (alat! >= latmin!) THEN
  85.            IF (along! <= longmax!) AND (along! >= longmin!) THEN
  86.               OK% = -1
  87.            END IF
  88.         END IF
  89.         IF OK% THEN
  90.            x! = INT(.5 + (longmax! - along!) * ppdy!): IF x! = 0 THEN x! = 1
  91.            y! = INT(.5 + (latmax! - alat!) * ppdy!)
  92.          ' Test for continuation of last line segment
  93.            IF (x! = oldx!) AND (oldy! = y!) THEN startflg% = 0
  94.            oldx! = x!
  95.            oldy! = y!
  96.            npts& = npts& + 1
  97.            IF startflg% THEN
  98.               icolor% = bcolor%
  99.               IF finx% = 1 THEN
  100.                  SELECT CASE aatc%
  101.                  CASE 1 TO 13: icolor% = 10
  102.                  REM CASE 2 OR 6: icolor% = 12
  103.                  CASE 14 TO 19: icolor% = 12
  104.                  CASE 20 TO 23: icolor% = 4
  105.                  CASE ELSE: icolor% = 7
  106.                  END SELECT
  107.               END IF
  108.               IF finx% = 3 THEN
  109.                  IF attrb% = 3095 THEN icolor% = 9' Intercoastal waterway
  110.               END IF
  111.               PSET (x! * Hfac! / 3, y! / 3), icolor%
  112.               PRINT #2, "   0,   0"
  113.               labnr% = labnr% + 1
  114.               lab = LEFT$(suffix, 1) + LTRIM$(STR$(labnr%))
  115.               PRINT #2, USING "##_,\    \"; icolor%; lab
  116.               PRINT #2, USING "####_,####"; x!; y!
  117.               ix% = INT(Hfac! * 80 * x! / (3 * 640)) + 1
  118.               iy% = INT(43 * y! / (3 * 350)) + 1
  119.               IF ix% > 75 THEN ix% = 75
  120.               IF iy% > 43 THEN iy% = 43
  121.               LOCATE iy%, ix%
  122.               PRINT lab;
  123.               nseg% = nseg% + 1
  124.               startflg% = 0
  125.            ELSE
  126.               IF ALLpts% THEN
  127.                  SkipPT% = 0
  128.               ELSEIF suffix = "st" OR suffix = "wb" OR suffix = "pb" OR suffix = "ab" THEN
  129.                  SkipPT% = NOT SkipPT%
  130.               ELSE SkipPT% = 0
  131.               END IF
  132.               IF NOT SkipPT% THEN 'Skip every other point for WB,ST,AB and PB
  133.                  LINE -(x! * Hfac! / 3, y! / 3), icolor%
  134.                  PRINT #2, USING "####_,####"; x!; y!
  135.               ELSE npts& = npts& - 1
  136.               END IF
  137.            END IF
  138.         ELSE
  139.            startflg% = -1
  140.         END IF
  141.         rcno& = rcno& + 1
  142.       LOOP
  143.       startflg% = -1
  144.     ELSE
  145.       rcno& = rstop& + 1
  146.     END IF
  147.   LOOP
  148.   tstop = TIME$
  149.   PRINT tstart; " "; tstop; minrec%; maxrec%
  150.   finx% = finx% + 1
  151.   cmaxrec& = LOF(2) \ 11
  152.   CLOSE 1
  153.   CLOSE 2
  154.   LOCATE 1, 1
  155.   PRINT "make notes for manual deletion/merge. Hit key to continue";
  156.   REM DO WHILE INKEY$ = "": LOOP
  157.   CALL redraw(cmaxrec&, datf)
  158.   OPEN datf FOR APPEND AS #2
  159. WEND
  160. CLOSE 1
  161. REM  Map extraction complete now thin map to reduce number of pts to 6000
  162. Thin% = INT(npts& \ (6000 - 2 * nseg% - 7)) + 1
  163. LOCATE 1, 1: PRINT "Total points:"; npts&
  164. LOCATE 1, 22: PRINT "You will have to keep every"; Thin%; "rd point to stay under 5000..."
  165. IF Thin% > 2 THEN
  166.    Thin% = 2
  167.    LOCATE 2, 1: PRINT "This is greater than 2 and may round off too many points.  You may select a"
  168.    INPUT "this number or use the default factor of 2.  Divide points by how many (2)"; Thin$
  169.    IF Thin$ <> "" THEN Thin% = VAL(Thin$) ELSE Thin% = 2
  170.    PRINT "Final # of pts will be"; npts& / Thin%
  171. END IF
  172. nrecm& = LOF(2) \ 11
  173. CLOSE 2
  174. ' re-open as a random file
  175. OPEN datf FOR RANDOM AS #2 LEN = 11
  176. OPEN mapf FOR RANDOM AS #1 LEN = 11
  177. FIELD 1, 11 AS stuff
  178. FIELD 2, 11 AS instuff
  179. 'copy first seven lines to output file
  180. FOR I% = 1 TO 8 'was 7
  181.     GET 2, I%
  182.     LSET stuff = instuff
  183.     PUT 1, I%
  184. NEXT I%
  185. xtest% = 0
  186. rstart& = 8 'was 7
  187. DO WHILE rstart& < nrecm&
  188.    WHILE NOT xtest%
  189.       GET 2, rstart&
  190.       rstart& = rstart& + 1
  191.       IF (LEFT$(instuff, 9) = "   0,   0") THEN xtest% = -1
  192.       IF rstart& > nrecm& THEN
  193.          xtest% = -1
  194.          rstart& = nrecm&
  195.       END IF
  196.    WEND
  197.    xtest% = 0
  198.    rstop& = rstart&
  199.    WHILE NOT xtest%
  200.       rstop& = rstop& + 1
  201.       GET 2, rstop& + 1
  202.       IF (LEFT$(instuff, 9) = "   0,   0") THEN xtest% = -1
  203.       IF rstop& > nrecm& THEN
  204.          rstop& = nrecm&
  205.          xtest% = -1
  206.       END IF
  207.    WEND
  208.    'Copy every thin(t)h record from input to output file
  209.    'If line segment has less than n points then skip,
  210.    ' but making sure first and last points the same
  211.    ' for both long and short segment
  212.    N% = (rstop& - rstart&) / Thin% + 1
  213.    rcno& = rstart&
  214.    IF N% > 2 THEN   'Forget short segments
  215.       LSET stuff = "   0,   0" + CHR$(&HD) + CHR$(&HA)
  216.       PUT 1
  217.       GET 2, rcno&
  218.       LSET stuff = instuff 'Color and segment label
  219.       PUT 1
  220.       rcno& = rcno& + 1
  221.       wflg% = -1
  222.       DO WHILE wflg%
  223.          IF rcno& < rstop& THEN
  224.             GET 2, rcno&
  225.             LSET stuff = instuff
  226.             PUT 1
  227.          ELSE
  228.             GET 2, rstop&
  229.             LSET stuff = instuff
  230.             PUT 1
  231.             wflg% = 0
  232.          END IF
  233.          x% = VAL(instuff)
  234.          y% = VAL(MID$(instuff, 6, 4))
  235.          PRESET (x% * Hfac! / 3, y% / 3), 15
  236.          rcno& = rcno& + Thin%
  237.       LOOP
  238.    END IF
  239.    rcno& = rstop& + 1
  240.    rstart& = rcno&
  241.    xtest% = 0
  242. LOOP
  243. CLOSE
  244. LOCATE 43, 1: INPUT "Map is complete... Hit ENTER to continue..."; a$
  245. CLS
  246. PRINT "Now your completed map is in file: "; mapf
  247. PRINT : PRINT
  248. CALL HELP
  249. STOP
  250.  
  251. Errortrap: Fault% = ERR
  252.            IF ERR = 75 THEN RESUME NEXT
  253. END
  254.  
  255. SUB fbook (finx%, f, fldr, bcolor%, suffix)
  256. SELECT CASE finx%
  257. CASE 1: suffix = "rd": bcolor% = 10
  258. CASE 2: suffix = "wb": bcolor% = 11
  259. CASE 3: suffix = "st": bcolor% = 3
  260. CASE 4: suffix = "pb": bcolor% = 6
  261. CASE 5: suffix = "ab": bcolor% = 2
  262. CASE 6: suffix = "cf": bcolor% = 9
  263. CASE 7: suffix = "rr": bcolor% = 8
  264. END SELECT
  265. f = fldr + suffix + ".grf"
  266. END SUB
  267.  
  268. SUB HELP
  269. PRINT "WHAT TO DO WITH THE TooLarge MAP PRODUCED BY THIS PROGRAM:"
  270. PRINT
  271. PRINT "Load MAPFIX and use the alt-JOIN command once.  Next use the alt-SMOOTH command"
  272. PRINT "twice (or so) to remove additional points.  I run alt-SMOOTH twice at 1.1 and"
  273. PRINT "twice at 1.2.  Beyond that, there is the danger of shortcutting long smooth"
  274. PRINT "curves in roads, etc.  Once you get down to about 3500 or so points, the last"
  275. PRINT "500 are best eliminated MANUALLY!  If you cant get below about 3600, then"
  276. PRINT "either re-run MAKEMAP with a smaller area, or use the alt-TRIM command to"
  277. PRINT "trim off excess area outside the alt-RANGE box."
  278.  
  279. PRINT
  280. PRINT "Hit R to reset the MAP pointer to the first point in the file and zoom into"
  281. PRINT "about the 8 mile range.  Hit the +/- keys to cycle through each and every point"
  282. PRINT "in the map and alt-DELETE any unnecessary points.  Use the (G) GO command"
  283. PRINT "to keep RE-CENTERING the map on the current MAPPOINT or use the Ctrl-A to"
  284. PRINT "toggle on AUTO-CENTERING.  Continue with the + key through the entire map to"
  285. PRINT "be sure you have looked at each and EVERY point.  This may take about an hour"
  286. PRINT "but can get rid of hundreds of unnecessary points!   There are lots of wasted"
  287. PRINT "and duplicate points in the following areas:"
  288. PRINT
  289. PRINT "    COUNTY LINES!  Who cares about the detail crooks and crannies!"
  290. PRINT "    INTERSTATES    Often, BOTH lanes are duplicated and identical!)"
  291. PRINT "    STREAMS        Who cares about every crook and bend..."
  292. PRINT "    RAILROADS      You may want to leave em out, or alt-KILL 'em with MAPFIX"
  293. PRINT
  294. PRINT "Don't stop at exactly 2999 points, however.  Go on down to about 2950 to"
  295. PRINT "leave a little room for adding 'personal' roads later.."
  296. PRINT
  297. PRINT "Use the ctrl-R command during the process to turn off the RE-DRAW function."
  298. PRINT "This makes the alt-DELETE process much faster.  SPACE bar will re-draw"
  299. PRINT "the map and turn RE-DRAW back on.  Similarly, hitting the END key will take"
  300. PRINT "you back to the map center and will toggle off AUTO-CENTERING."
  301. PRINT
  302. PRINT
  303. INPUT "Hit ENTER to continue..."; a$
  304.  
  305. END SUB
  306.  
  307. SUB init (mapf, datf, fldr)
  308. REM DIM SHARED lat0!, long0!, latmax!, longmax!, ppdy!, ppdx!
  309. REM DIM SHARED latmin!, longmin!
  310. CLS
  311. PRINT "WB4APR INTRODUCTION AND COMMENT:        "; version$
  312. PRINT
  313. PRINT "This program was written by Jack Cavanagh, KB4XF to extract APRS map points"
  314. PRINT "Directly from the 2,000,000:1 CD ROM.  It is a hands-off, total map making"
  315. PRINT "process.  It extrtacts all points within a given range of a given lat/long"
  316. PRINT "point and saves them in an APRS compatible file named XXXXX.DAT."
  317. PRINT
  318. PRINT "Then it uses a brute-force reduction technique that scans the total file and"
  319. PRINT "only keeps every Nth point.   As long as N is on the order of 2 or 3, this is"
  320. PRINT "not much of a problem, since the USGS data base has at least 100 points to"
  321. PRINT "the inch at the original map scale.  The map is then saved as XXXXX.MAP."
  322. PRINT
  323. PRINT "To minimize this truncation, I (APR) have modifed his program to permit "
  324. PRINT "twice the nominal 3000 limit during this first reduction process.  By also"
  325. PRINT "limiting the initial number of points by choosing a smaller area (30 miles"
  326. PRINT "or so (in the East) the result is a quite adequate map which can then be"
  327. PRINT "loaded into MAPFIX where you may then use the more intelligent MAPFIX"
  328. PRINT "alt-SMOOTH command and other techniques to eliminate more points down to the"
  329. PRINT "nominal 3000 point limit."
  330. PRINT
  331. PRINT
  332. INPUT "Hit ENTER to proceed... OR hit H for more HELP"; a$
  333. SCREEN 9
  334. WIDTH 80, 43
  335. PALETTE 6, 6
  336.  
  337. IF UCASE$(a$) = "H" THEN CALL HELP
  338. CLS
  339. PRINT
  340. PRINT "The Digital Line Graph CD is divided into the following sectors."
  341. PRINT
  342. PRINT : PRINT "1 - ME,NH,VT,MA,RI,CT,NY", TAB(40); , "12 - AZ,NM"
  343. PRINT : PRINT "2 - NJ,PA,OH,DE,MD,WV,VA", TAB(40); , "13 - Southern CA"
  344. PRINT : PRINT "3 - NC,SC,GA", TAB(40); , "14 - Northern CA,NV,UT"
  345. PRINT : PRINT "4 - Florida", TAB(40); , "15 - WA,OR,ID,Western MT"
  346. PRINT : PRINT "5 - TN,AL,MS,AK,LA", TAB(40); , "16 - SE Alaska"
  347. PRINT : PRINT "6 - KY,IN,IL,IA,MO", TAB(40); , "17 - Central Alaska"
  348. PRINT : PRINT "7 - MI,WI,MN", TAB(40); , "18 - Northern Alaska"
  349. PRINT : PRINT "8 - Southern TX", TAB(40); , "19 - SW Alaska"
  350. PRINT : PRINT "9 - OK, Northern TX", TAB(40); , "20 - Aleutian Is."
  351. PRINT : PRINT "10- KN,NB,CO", TAB(40); , "21 - Hawaiian Is."
  352. PRINT : PRINT "11- ND,SD,WY MT(east of divide)"
  353. PRINT
  354. PRINT : INPUT "Enter your sector"; sect%
  355. PRINT : INPUT "Enter letter designation for CD ROM drive ", d$
  356. sectc$ = RIGHT$(STR$(INT(100 + sect%)), 2)
  357. fldr = LEFT$(d$, 1) + ":\graphic\sect" + sectc$ + "\s" + sectc$ + "_"
  358. CLS
  359. PRINT "File name leader is "; fldr
  360. PRINT : INPUT "Enter a file name for results (.map) will be added "; mapf
  361. PRINT : INPUT "Enter latitude of map center in degrees,minutes (DD,MM) "; lat0!, latm!
  362. PRINT : INPUT "Enter longitude of map center in degrees,minutes (DDD,MM) "; long0!, longm!
  363. lat0! = lat0! + latm! / 60
  364. long0! = long0! + longm! / 60
  365.    PRINT
  366.    PRINT "Now select the map size.  In order to get about the right number of points"
  367.    PRINT "Select 30 to 36 miles for anywhere East of the Mississippi.  Maybe 50 miles"
  368.    PRINT "in the rural farm areas, and possibly 70 miles in the VERY sparse states."
  369.    PRINT
  370.    PRINT "You may go larger to get a larger map, and then spend lots more time using"
  371.    PRINT "MAPFIX to remove un-needed points."
  372.  
  373. PRINT : INPUT "Enter map radius in miles ", mradm!
  374. PRINT : INPUT "Skip every other point in the Waterways and Borders (y/n) (Y)"; a$
  375. IF UCASE$(a$) <> "N" THEN ALLpts% = 0 ELSE ALLpts% = -1
  376. datf = mapf + ".dat"
  377. mapf = mapf + ".map"
  378. rady! = mradm! / 60
  379. radx! = 4 * mradm! / (COS(3.1416 * lat0! / 180) * 3 * 60)' Screen aspect ratio
  380. latmax! = lat0! + rady!
  381. latmin! = lat0! - rady!
  382. longmax! = long0! + radx!
  383. longmin! = long0! - radx!
  384. ppdy! = INT(.5 + (525! / (rady!))) 'had been 350/(2*rady)  I just made it 3X
  385. ppdx! = INT(.5 + (960! / (radx!))) 'had been 640/(2*radx)
  386. Hfac! = ppdx! / ppdy!
  387. OPEN datf FOR OUTPUT AS #2
  388. PRINT #2, USING "###.####_,"; latmax!
  389. PRINT #2, USING "###.####_,"; longmax!
  390. PRINT #2, USING "#####.##_,"; ppdy!
  391. PRINT #2, USING "###.####_,"; lat0!
  392. PRINT #2, USING "###.####_,"; long0!
  393. PRINT #2, USING "###.####_,"; mradm!
  394. PRINT #2, "0,resrved"
  395. PRINT #2, "comments "
  396. CLS
  397. REM SCREEN 9
  398. REM WIDTH 80, 43
  399. REM PALETTE 6, 6
  400.  
  401. END SUB
  402.  
  403. SUB redraw (cmaxrec&, datf) STATIC
  404. nrec& = 8
  405. CLS
  406. OPEN datf FOR RANDOM AS #2 LEN = 11
  407. FIELD 2, 11 AS stuff
  408. WHILE nrec& < cmaxrec&
  409. GET 2, nrec&
  410.   IF stuff = "   0,   0" + CHR$(&HD) + CHR$(&HA) THEN
  411.      GET 2, nrec& + 1
  412.      clr% = VAL(stuff)
  413.      nrec& = nrec& + 2
  414.      GET 2, nrec&
  415.      x% = VAL(stuff)
  416.      y% = VAL(RIGHT$(stuff, 6)) 'had been 5
  417.      PSET (x% * Hfac! / 3, y% / 3), clr%
  418.      nrec& = nrec& + 1
  419.   ELSE
  420.      x% = VAL(stuff)
  421.      y% = VAL(RIGHT$(stuff, 6)) 'had been 5
  422.      LINE -(x% * Hfac! / 3, y% / 3), clr%
  423.      nrec& = nrec& + 1
  424.    END IF
  425. WEND
  426. CLOSE 2
  427. LOCATE 1, 58: PRINT "CD pts so far:"; cmaxrec&
  428. END SUB
  429.  
  430. SUB test (rcno&, rstop&, testflg%, finx%, attrb%)
  431. 'COMMON SHARED lat0!, long0!, latmax!, longmax!, ppdy!, ppdx!
  432. 'COMMON SHARED latmin!, longmin!
  433. ' Test last point to see if it is on map
  434. FIELD #1, 2 AS lad, 2 AS lam, 3 AS las, 3 AS lod, 2 AS lom, 2 AS los, 6 AS d$
  435. GET 1, rstop&
  436. alat! = VAL(lad) + VAL(lam) / 60 + VAL(las) / 3600
  437. along! = VAL(lod) + VAL(lom) / 60 + VAL(los) / 3600
  438. testflg% = 0
  439. IF (alat! <= latmax!) AND (alat! >= latmin!) THEN
  440.   IF (along! <= longmax!) AND (along! >= longmin!) THEN
  441.      testflg% = -1
  442.   END IF
  443. END IF
  444. ' Test midpoint to see if it falls on the map
  445. recmid& = (rstop& + rcno&) \ 2
  446. GET 1, recmid&
  447. alat! = VAL(lad) + VAL(lam) / 60 + VAL(las) / 3600
  448. along! = VAL(lod) + VAL(lom) / 60 + VAL(los) / 3600
  449. IF (alat! <= latmax!) AND (alat! >= latmin!) THEN
  450.   IF (along! <= longmax!) AND (along! >= longmin!) THEN
  451.      testflg% = -1
  452.   END IF
  453. END IF
  454. ' Test first point to see if it is  on map
  455. GET 1, rcno&
  456. alat! = VAL(lad) + VAL(lam) / 60 + VAL(las) / 3600
  457. along! = VAL(lod) + VAL(lom) / 60 + VAL(los) / 3600
  458. IF (alat! <= latmax!) AND (alat! >= latmin!) THEN
  459.   IF (along! <= longmax!) AND (along! >= longmin!) THEN
  460.      testflg% = -1
  461.   END IF
  462. END IF
  463. 'This limits stream data to eliminate small lakes
  464. ' and river centerlines
  465. IF finx% = 3 THEN
  466.   IF attrb% = 3002 THEN testflg% = 0
  467.   IF attrb% > 3030 AND attr% < 3070 THEN testflg% = 0
  468.   REM IF attrb% = 3095 THEN testflg% = 0' Intercoastal waterway
  469. END IF
  470.  
  471. END SUB
  472.  
  473.