Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucbvax!agate!apple!sun-barr!texsun!texbell!vector!attctc!sampson
From: sampson@attctc.Dallas.TX.US (Steve Sampson)
Newsgroups: comp.graphics
Subject: Map Projection and Database (Part 6 of 6)
Message-ID: <8971@attctc.Dallas.TX.US>
Date: 12 Aug 89 10:50:19 GMT
Organization: The Unix(R) Connection, Dallas, Texas
Lines: 1505


#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh MAP.C <<'END_OF_MAP.C'
X/*
X *      map.c
X *
X *      This program draws three types of map projections - Perspective,
X *      Modified Perspective, and Azimuthal Equidistant.
X *
X *      Version 2.1 by MSgt Steven R. Sampson, N5OWK, 11 July 1989
X *      Based on a program and article by William D. Johnston
X *      Copyright (c) May-June 1979 BYTE, All Rights Reserved
X *
X *      Compiled with Turbo-C V1.5, Requires EGA or VGA with 2 graphic pages.
X */
X
X#include 
X#include 
X#include 
X#include 
X#include 
X#include 
X#include 
X
Xtypedef int     bool;
X
X/* Program Constants */
X
X#define FALSE   (bool) 0
X#define TRUE    (bool) ~FALSE
X
X#define PI      (3.141593F)             /* Turbo-C'ism - F means float...    */
X#define HALFPI  (1.570796F)             /* ..vice double, for slight speedup */
X#define TWOPI   (2.0F * PI)             /* Two Pi alias 360 Degrees          */
X#define RADIAN  (180.0F / PI )          /* One radian                        */
X#define TWO     (2.0F / RADIAN)         /* 2 Degrees in radians              */
X#define TEN     (10.0F / RADIAN)        /* 10 degrees in radians             */
X#define EIGHTY  (80.0F / RADIAN)        /* 80 degrees in radians             */
X#define EARTH   (6378.135F)             /* Mean radius of earth (Kilometers) */
X
X/* Program Globals */
X
XFILE    *fp;
X
Xstruct  {                               /* Binary Database Format (BYTESWAP) */
X        int     code, lat, lon;
X} coord;
X
Xfloat   angle, maxplot, center_lat, center_lon, lat, lon, distance,
X        sin_of_distance, cos_of_distance, sin_of_center_lat, cos_of_center_lat,
X        scale, g, h2, facing_azimuth, aspect;
X
Xint     option, center_x, center_y, grid_color, level = 5;
Xint     GraphDriver = DETECT, GraphMode;
X
Xchar    optstring[] = "bcd:gilm:rsxy?";
Xchar    database[128] = "mwdbii";       /* default name 'MWDBII'             */
X                                        /* leave room for pathname           */
Xbool    boundaries = TRUE,              /* defaults to Boundaries, Islands   */
X        countries  = FALSE,
X        grids      = FALSE,
X        islands    = TRUE,
X        lakes      = FALSE,
X        rivers     = FALSE,
X        states     = FALSE,
X        colors     = FALSE;
X
X/* Forward Declarations, Prototypes */
X
Xextern  int     directvideo;
X
Xextern  int     getopt(int, char **, char *);
Xextern  int     optind, opterr;
Xextern  char    *optarg;
X
X/* /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\  */
Xextern  char    SW;     /*!!! modified getopt.c SW from static to global !!!!*/
X/* \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/  */
X
Xdouble  dm2dec(double);
Xvoid    grid(void), plotmap(void), prompts(void), quit(void), query(void);
Xbool    compute(float *, float *, int *, int *), move(int);
X
Xmain(argc, argv)
Xint     argc;
Xchar    *argv[];
X{
X        register int    i;
X        int             err, xasp, yasp;
X
X        registerbgidriver(EGAVGA_driver);       /* IBM Driver                */
X        registerbgifont(small_font);
X
X        setcbrk(TRUE);          /* Allow Control-C checking                  */
X        ctrlbrk(quit);          /* Execute quit() if Control-C detected      */
X
X        /* This depends on Turbo-C getopt() and MS-DOS SWITCH char (- or /)  */
X
X        while ((i = getopt(argc, argv, optstring)) != -1)  {
X                switch (i)  {
X                case 'b':
X                        boundaries = FALSE;
X                        break;
X                case 'c':
X                        countries = TRUE;
X                        break;
X                case 'd':
X                        strcpy(database, optarg);
X                        break;
X                case 'g':
X                        grids = TRUE;
X                        break;
X                case 'i':
X                        islands = FALSE;
X                        break;
X                case 'l':
X                        lakes = TRUE;
X                        break;
X                case 'm':
X                        level = atoi(optarg);
X                        break;
X                case 'r':
X                        rivers = TRUE;
X                        break;
X                case 's':
X                        states = TRUE;
X                        break;
X                case 'x':
X                        colors = TRUE;
X                        break;
X                case 'y':
X                        directvideo = 0;
X                        break;
X                case '?':
X                default:
X                      printf("Usage: map [%cbcdgilmrsxy]\n\n", SW);
X                      printf("  %cb   Boundaries Off\n", SW);
X                      printf("  %cc   Countries On\n", SW);
X                      printf("  %cdn  Database ('MWDBII' Default)\n", SW);
X                      printf("  %cg   Grid lines On\n", SW);
X                      printf("  %ci   Islands Off\n", SW);
X                      printf("  %cl   Lakes On\n", SW);
X                      printf("  %cmn  Map Resolution (5 Default)\n", SW);
X                      printf("  %cr   Rivers On\n", SW);
X                      printf("  %cs   States On\n", SW);
X                      printf("  %cx   Colors On\n", SW);
X                      printf("  %cy   BIOS Video Mode On\n\n", SW);
X                      printf("Defaults to Boundaries and Islands On\n");
X
X                      exit(0);
X                }
X        }
X
X        if ((fp = fopen(database, "rb")) == (FILE *)NULL)  {
X                printf("\007Error: Can't locate Database '%s'\n", database);
X                exit(1);
X        }
X
X        initgraph(&GraphDriver, &GraphMode, "");/* initialize graphics       */
X        err = graphresult();
X
X        restorecrtmode();                       /* get back to text mode     */
X
X        if (err < 0)  {
X                printf("Graphics Error - %s\n", grapherrormsg(err));
X                exit(1);
X        }
X
X        if (GraphMode == VGAHI)                 /* Use medium resolution     */
X                GraphMode = VGAMED;             /*   for 2 graphic pages     */
X
X        center_x = getmaxx() / 2;               /* get screen size for x, y  */
X        center_y = getmaxy() / 2;
X        getaspectratio(&xasp, &yasp);           /* squish factor for y axis  */
X        aspect = (float)xasp / (float)yasp;
X
X        prompts();                              /* get the basic map info    */
X
X        setgraphmode(GraphMode);                /*  and go to graphics mode  */
X        setbkcolor(BLACK);
X
X        if (colors)
X                grid_color = EGA_CYAN;
X        else
X                grid_color = EGA_LIGHTGRAY;
X
X        if (grids)
X                grid();                         /* draw lat & long ref lines */
X
X        setcolor(LIGHTGRAY);
X
X        /*
X         *      See if data plotting is even needed
X         */
X
X        if (boundaries || countries || islands || lakes || rivers || states)
X                plotmap();                      /* display map on screen     */
X
X        setcolor(LIGHTGRAY);
X        outtextxy(0, getmaxy() - 10, "Done");
X        getch();                                /* wait for end of viewing   */
X
X        closegraph();                           /* graphics off              */
X        fclose(fp);                             /* close database file       */
X
X        exit(0);
X}
X
X/*
X *      Return to operator following Control-C
X */
X
Xvoid quit()
X{
X        closegraph();
X        fclose(fp);
X        exit(0);
X}
X
X/*
X *      Operator prompts and input.
X */
X
Xvoid prompts()
X{
X        float   ret, altitude;
X
X        printf("West Longitudes and South Latitudes are negative\n");
X
X        /* input the world Lat & Long that is to be centered on */
X        /*   then convert the human notation to radians         */
X
X        do  {
X                printf("\nLatitude of the map center [+-]dd.mm : ");
X                scanf("%f", &ret);
X                ret = dm2dec(ret);
X        } while (ret > 90.0F || ret < -90.0F);
X
X        /* the arcosine function has trouble at 90 degrees */
X
X        if (ret == 90.0F)
X                center_lat = 89.9F / RADIAN;
X        else if (ret == -90.0F)
X                center_lat = -89.9F / RADIAN;
X        else
X                center_lat = ret / RADIAN;
X
X        sin_of_center_lat = sin(center_lat);
X        cos_of_center_lat = cos(center_lat);
X
X        do  {
X                printf("Longitude of the map center [+-]ddd.mm : ");
X                scanf("%f", &ret);
X                ret = dm2dec(ret);
X        } while (ret > 180.0F || ret < -180.0F);
X
X        center_lon = ret / RADIAN;
X
X        do  {
X                printf("\nSelect from the following options:\n\n");
X                printf("  1 - Perspective Projection\n");
X                printf("  2 - Modified Perspective Projection\n");
X                printf("  3 - Azimuthal Equidistant Projection\n\n");
X                printf("Choice : ");
X                scanf("%d", &option);
X        } while (option < 1 || option > 3);
X
X        if (option == 3)  {
X                /* input the radial distance to map */
X
X                do  {
X                        printf("\nArc Distance (1 - 180 degrees) : ");
X                        scanf("%f", &maxplot);
X                } while (maxplot == 0.0F || maxplot > 180.0F);
X
X                maxplot /= RADIAN;
X                scale = (float) center_y / maxplot;
X                return;
X        }
X
X        /* input the height above the terrain */
X
X        printf("\nObserver altitude (km) : ");
X        scanf("%f", &altitude);
X
X        if (altitude == 0.0F)
X                altitude = 1.0F;
X
X        h2 = EARTH + altitude;
X        maxplot = acos(EARTH / h2);
X
X        /* The operator can orient the world upside down if they want */
X
X        do  {
X                printf("Observer facing azimuth (0 - 359 degrees) : ");
X                scanf("%f", &facing_azimuth);
X        } while (facing_azimuth < 0.0F || facing_azimuth > 360.0F);
X
X        facing_azimuth = -facing_azimuth / RADIAN;
X
X        /* Calculate the scale for the polar coordinates */
X
X        scale = (float)center_y / (EARTH * sin(maxplot));
X
X        /* For the perspective projection */
X
X        g = EARTH * (h2 - EARTH * cos(maxplot));
X}
X
X/*
X *      Convert the database to the desired projection by computation.
X *
X *      This code is a hand translation from BASIC to C based on Mr. Johnstons
X *      code.  It is a non-mathematicians idea of what he meant.
X *
X *      Return TRUE if offscale else FALSE.
X */
X
Xbool compute(lat, lon, x, y)
Xregister float  *lat, *lon;                     /* 16 bits, rather than 32   */
Xregister int    *x, *y;
X{
X        float   sin_of_lat,
X                cos_of_lat,
X                abs_delta_lon,                  /* absolute value            */
X                delta_lon,                      /* x distance from center    */
X                delta_lat,                      /* y distance from center    */
X                temp;                           /* temporary storage         */
X
X        /* normalize the longitude to +/- PI */
X
X        delta_lon = *lon - center_lon;
X
X        if (delta_lon < -PI)
X                delta_lon = delta_lon + TWOPI;
X
X        if (delta_lon > PI)
X                delta_lon = delta_lon - TWOPI;
X
X        abs_delta_lon = fabs(delta_lon);
X
X        /*
X         *      If the delta_lon is within .00015 radians of 0 then
X         *      the difference is considered exactly zero.
X         *
X         *      This also simplifies the great circle bearing calculation.
X         */
X
X        if (abs_delta_lon <= 0.00015F)  {
X                delta_lat = fabs(center_lat - *lat);
X
X                if (delta_lat > maxplot)
X                        return TRUE;            /* offscale                  */
X
X                if (*lat < center_lat)
X                        angle = PI;
X                else
X                        angle = 0.0F;
X
X                sin_of_distance = sin(delta_lat);
X                cos_of_distance = cos(delta_lat);
X        }
X
X        /*
X         *      Check if delta_lon is within .00015 radians of PI.
X         */
X
X        else if (fabs(PI - abs_delta_lon) <= 0.00015F)  {
X                delta_lat = PI - center_lat - *lat;
X
X                if (delta_lat > PI)  {
X                        delta_lat = TWOPI - delta_lat;
X                        angle = PI;
X                } else
X                        angle = 0.0F;
X
X                if (delta_lat > maxplot)
X                        return TRUE;            /* offscale                  */
X
X                sin_of_distance = sin(delta_lat);
X                cos_of_distance = cos(delta_lat);
X        }
X
X        /*
X         *      Simple calculations are out, now get cosmic.
X         */
X
X        else  {
X                sin_of_lat = sin(*lat);
X                cos_of_lat = cos(*lat);
X
X                cos_of_distance = sin_of_center_lat * sin_of_lat +
X                                    cos_of_center_lat * cos_of_lat *
X                                      cos(delta_lon);
X
X                distance = acos(cos_of_distance);
X
X                if (distance > maxplot)
X                        return TRUE;            /* offscale                  */
X
X                sin_of_distance = sin(distance);
X
X                temp = (sin_of_lat - sin_of_center_lat * cos_of_distance) /
X                        (cos_of_center_lat * sin_of_distance);
X
X                if (temp < -1.0F || temp > 1.0F)
X                        return TRUE;            /* offscale                  */
X
X                angle = acos(temp);
X
X                if (delta_lon < 0.0F)
X                        angle = TWOPI - angle;
X        }
X
X        if (facing_azimuth != 0.0F)  {
X                angle = angle - facing_azimuth;
X                if (angle < 0.0F)
X                        angle = TWOPI + angle;
X        }
X
X        angle = HALFPI - angle;
X
X        if (angle < -PI)
X                angle = angle + TWOPI;
X
X        switch (option)  {
X        case 1:
X                temp  = (scale * (g * sin_of_distance)) /
X                                (h2 - EARTH * cos_of_distance);
X                break;
X        case 2:
X                temp = scale * EARTH * sin_of_distance;
X                break;
X        case 3:
X                temp = scale * distance;
X        }
X
X        /* convert polar to rectangular, correct for screen aspect */
X
X        *x = center_x + (int)(temp * cos(angle));
X        *y = center_y - (int)(temp * sin(angle) * aspect);
X
X        return FALSE;
X}
X
X/*
X *      Read the database and plot points or lines.
X *      See DATA.DOC in MAPDAT.ARC for database description.
X */
X
Xvoid plotmap()
X{
X        float   lat, lon;
X        int     x, y;
X        bool    point;
X
X        point = TRUE;
X        while (fread(&coord, sizeof coord, 1, fp) > 0)  {
X
X                if (kbhit())  {
X                        getch();
X                        query();
X                }
X
X                /*
X                 *      Skip data that has been optioned out.
X                 */
X
X                if (coord.code < level)
X                        continue;
X
X                if (coord.code > 5)  {          /* must be a header          */
X
X                        point = TRUE;
X
X                        switch (coord.code / 1000)  {
X                        case 1:
X                                if (boundaries)  {
X                                        if (colors)
X                                                setcolor(EGA_LIGHTGRAY);
X                                        break;
X                                } else  {
X                                        if (move(1))
X                                                return;
X                                        continue;
X                                }
X                        case 2:
X                                if (countries)  {
X                                        if (colors)
X                                                setcolor(EGA_BROWN);
X                                        break;
X                                } else  {
X                                        if (move(2))
X                                                return;
X                                        continue;
X                                }
X                        case 4:
X                                if (states)  {
X                                        if (colors)
X                                                setcolor(EGA_BROWN);
X                                        break;
X                                } else  {
X                                        if (move(4))
X                                                return;
X                                        continue;
X                                }
X                        case 5:
X                                if (islands)  {
X                                        if (colors)
X                                                setcolor(EGA_LIGHTGRAY);
X                                        break;
X                                } else  {
X                                        if (move(5))
X                                                return;
X                                        continue;
X                                }
X                        case 6:
X                                if (lakes)  {
X                                        if (colors)
X                                                setcolor(EGA_BLUE);
X                                        break;
X                                } else  {
X                                        if (move(6))
X                                                return;
X                                        continue;
X                                }
X                        case 7:
X                                if (rivers)  {
X                                        if (colors)
X                                                setcolor(EGA_GREEN);
X                                        break;
X                                } else  {
X                                        if (move(7))
X                                                return;
X                                        continue;
X                                }
X                        }
X                }
X
X                /*  Convert database minutes of a degree to radians */
X
X                lat =  (float) coord.lat / 60.0F / RADIAN;
X                lon =  (float) coord.lon / 60.0F / RADIAN;
X
X                if (compute(&lat, &lon, &x, &y))  {
X                        point = TRUE;           /* offscale                  */
X                        continue;
X                }
X
X                if (point)  {
X                        putpixel(x, y, getcolor());/* put down a dot         */
X                        moveto(x, y);
X                        point = FALSE;
X                }
X                else
X                        lineto(x, y);           /* connect the dots          */
X        }
X}
X
X/*
X *      Move to next database characteristic
X *
X *      Returns TRUE for end of file, else FALSE
X */
X
Xbool move(n)
Xint     n;
X{
X        while (fread(&coord, sizeof coord, 1, fp) > 0)  {
X                if ((coord.code > 5) && ((coord.code/1000) != n))
X                        return FALSE;
X        }
X
X        return TRUE;
X}
X
X/*
X *      Convert +-ddd.mm
X *
X *      Change degrees and minutes to decimal
X */
X
Xdouble dm2dec(degmin)
Xdouble  degmin;
X{
X        double  t;
X
X        t = (int)degmin;        /* get the integer part */
X        degmin -= t;            /* now the fractional part */
X        degmin /= .60;          /* convert minutes to decimal */
X
X        return (degmin + t);    /* add the two */
X}
X
X/*
X *      Draw grid lines
X *
X *      Azimuthal Equidistant - Draw a radar scope presentation,
X *      All others - From -180 to +180 Degrees (Longitude Lines),
X *      and +80 to -80 Degrees (Latitude Lines).
X */
X
Xvoid grid()
X{
X        float   lat, lon, bearing;
X        int     x, y, pass1;
X
X        setcolor(grid_color);
X
X        if (option == 3)  {
X
X                /*
X                 *      Hide the drawing until finished
X                 */
X
X                setvisualpage(0);
X                setactivepage(1);
X
X                circle(center_x, center_y, center_y);      /* inner ring     */
X                circle(center_x, center_y, center_y + 10); /* outer ring     */
X
X                /*
X                 *      Ten Degree Full size ticks
X                 */
X
X                for (bearing = 0.0F; bearing < TWOPI; bearing += TEN)  {
X                        moveto(center_x, center_y);
X                        x = center_x + (int)((float)(center_y + 10) * sin(bearing));
X                        y = center_y - (int)((float)(center_y + 10) * cos(bearing) * aspect);
X                        lineto(x, y);
X                }
X
X                /*
X                 *      Two Degree Half size ticks
X                 */
X
X                for (bearing = 0.0F; bearing < TWOPI; bearing += TWO)  {
X                        moveto(center_x, center_y);
X                        x = center_x + (int)((float)(center_y + 5) * sin(bearing));
X                        y = center_y - (int)((float)(center_y + 5) * cos(bearing) * aspect);
X                        lineto(x, y);
X                }
X
X                /*
X                 *      This routine erases all bearing lines except
X                 *      those between the two circles.
X                 */
X
X                setcolor(WHITE);
X                circle(center_x, center_y, center_y);
X
X                settextjustify(CENTER_TEXT, CENTER_TEXT);
X                setfillstyle(SOLID_FILL, BLACK);
X
X                floodfill(center_x, center_y, WHITE);
X
X                setcolor(grid_color);
X                circle(center_x, center_y, center_y);
X
X                /*
X                 *      Mark the center
X                 */
X
X                outtextxy(center_x, center_y, "+");
X
X                /*
X                 *      Label the Axis
X                 */
X
X                settextstyle(SMALL_FONT, HORIZ_DIR, 4);
X
X                outtextxy(center_x, 20, "360");
X                outtextxy(520, center_y, "090");
X                outtextxy(center_x, 330, "180");
X                outtextxy(120, center_y, "270");
X
X                /*
X                 *      Return to defaults
X                 */
X
X                settextstyle(DEFAULT_FONT, HORIZ_DIR, 1);
X                settextjustify(LEFT_TEXT, LEFT_TEXT);
X                setvisualpage(1);
X        } else  {
X                setlinestyle(DOTTED_LINE, NULL, NORM_WIDTH);
X
X                for (lon = -PI; lon <= PI; lon += TEN)  {
X                        pass1 = TRUE;
X                        for (lat = EIGHTY; lat > -EIGHTY; lat -= TEN)  {
X                                if (!compute(&lat, &lon, &x, &y))  {
X                                        if (pass1)  {
X                                                putpixel(x, y, grid_color);
X                                                moveto(x, y);
X                                                pass1 = FALSE;
X                                        } else
X                                                lineto(x, y);
X                                } else
X                                        pass1 = TRUE;
X                        }
X
X                        if (kbhit())  {
X                                getch();
X                                query();
X                        }
X                }
X
X                for (lat = EIGHTY; lat > -EIGHTY; lat -= TEN)  {
X                        pass1 = TRUE;
X                        for (lon = -PI; lon <= PI; lon += TEN)  {
X                                if (!compute(&lat, &lon, &x, &y))  {
X                                        if (pass1)  {
X                                                putpixel(x, y, grid_color);
X                                                moveto(x, y);
X                                                pass1 = FALSE;
X                                        } else
X                                                lineto(x, y);
X                                } else
X                                        pass1 = TRUE;
X
X                        }
X
X                        if (kbhit())  {
X                                getch();
X                                query();
X                        }
X                }
X
X                setlinestyle(SOLID_LINE, NULL, NORM_WIDTH);
X        }
X}
X
Xvoid query()
X{
X        char    s[] = "Press ESC to exit, any key to continue";
X        int     x, y;
X
X        sound(1000);                            /* 1000 Hz for fourth/second */
X        delay(250);
X        nosound();
X
X        x = getx();                             /* remember last location    */
X        y = gety();
X        outtextxy(0, getmaxy() - 10, s);
X
X        if (getch() == '\033')  {               /* Escape character?         */
X                closegraph();                   /* graphics off              */
X                fclose(fp);                     /* close database file       */
X
X                exit(0);
X        }
X
X        setcolor(BLACK);
X        outtextxy(0, getmaxy() - 10, s);
X        setcolor(LIGHTGRAY);
X        moveto(x, y);                           /* go back to last location  */
X}
X
X/* That is all */
END_OF_MAP.C
if test 25052 -ne `wc -c MWDBII.011 <<'END_OF_MWDBII.011'
X4, 44.59, -74.59
X5, 45.01, -73.21
X2253, 45.01, -73.22
X5, 45.01, -71.30
X2254, 45.01, -71.30
X5, 45.18, -71.05
X2255, 45.18, -71.06
X4, 45.24, -70.39
X5, 47.28, -69.14
X4, 47.11, -68.54
X4, 47.04, -67.48
X4, 45.42, -67.48
X5, 45.11, -67.12
X2256, 55.55, -130.01
X4, 56.36, -131.49
X4, 58.25, -133.22
X5, 59.48, -135.28
X4, 59.10, -136.35
X4, 58.54, -137.27
X4, 60.05, -139.11
X4, 60.21, -139.04
X5, 60.18, -141.00
X5, 69.39, -141.00
X2257, 14.33, -92.15
X4, 15.16, -92.13
X5, 16.04, -91.44
X5, 16.06, -90.26
X4, 16.25, -90.24
X4, 17.14, -91.26
X4, 17.15, -90.59
X5, 17.49, -90.59
X5, 17.49, -89.08
X2258, 17.49, -89.08
X5, 18.29, -88.18
X2259, 17.49, -89.08
X4, 15.54, -89.13
X5, 15.54, -88.55
X2260, 15.43, -88.13
X4, 15.04, -89.09
X5, 14.26, -89.21
X2261, 14.26, -89.21
X5, 13.45, -90.06
X2262, 12.59, -87.18
X4, 13.18, -86.42
X4, 13.45, -86.46
X4, 14.04, -86.01
X4, 13.50, -85.44
X4, 14.48, -84.54
X5, 15.00, -83.08
X2263, 14.26, -89.21
X4, 13.51, -88.28
X4, 13.54, -87.47
X5, 13.26, -87.50
X2264, 11.05, -85.41
X4, 11.04, -84.40
X4, 10.42, -83.55
X5, 10.55, -83.39
X2265, 9.34, -82.34
X4, 9.28, -82.56
X4, 8.56, -82.43
X4, 8.19, -83.03
X5, 8.02, -82.54
X2266, 9.23, -79.50
X4, 9.11, -79.41
X4, 9.20, -79.33
X5, 8.56, -79.32
X2267, 9.17, -80.02
X4, 9.01, -80.05
X5, 8.53, -79.36
X2268, 19.42, -71.45
X4, 19.09, -71.38
X4, 18.46, -71.43
X4, 18.36, -72.00
X4, 18.19, -71.42
X5, 18.03, -71.47
X2269, 8.40, -77.22
X4, 7.57, -77.09
X4, 7.32, -77.34
X4, 7.43, -77.45
X5, 7.14, -77.53
X2270, 1.26, -78.49
X4, 0.51, -77.41
X4, 0.23, -77.22
X4, 0.23, -76.07
X5, -0.06, -75.17
X2271, -0.06, -75.17
X4, -0.10, -74.49
X4, -0.58, -74.16
X4, -1.16, -73.38
X4, -1.47, -73.12
X5, -2.26, -72.56
X4, -2.25, -72.10
X4, -2.08, -71.44
X4, -2.23, -71.25
X5, -2.38, -70.06
X5, -3.47, -70.43
X4, -3.48, -70.19
X5, -4.13, -69.57
X2272, -0.06, -75.17
X4, -0.07, -75.38
X4, -0.58, -75.13
X4, -0.58, -75.25
X4, -1.33, -75.34
X4, -2.34, -76.40
X4, -2.59, -77.51
X4, -3.25, -78.20
X5, -5.00, -79.02
X4, -4.26, -79.38
X5, -4.26, -80.29
X4, -3.59, -80.28
X4, -3.53, -80.09
X5, -3.22, -80.22
X2273, -4.13, -69.57
X4, -4.29, -71.47
X5, -5.08, -72.54
X4, -6.27, -73.09
X4, -6.53, -73.45
X4, -7.18, -73.42
X5, -7.32, -74.01
X4, -8.59, -72.58
X5, -9.24, -73.12
X4, -9.30, -72.22
X4, -10.00, -72.09
X4, -10.00, -71.18
X5, -9.26, -70.31
X5, -11.01, -70.38
X5, -10.57, -69.34
X2274, -10.57, -69.34
X5, -12.30, -68.40
X4, -13.39, -69.05
X4, -14.12, -68.51
X4, -14.48, -69.22
X4, -15.15, -69.08
X4, -15.37, -69.25
X4, -16.10, -69.13
X4, -16.20, -68.49
X4, -17.11, -69.37
X5, -17.30, -69.30
X2275, -17.30, -69.30
X4, -17.41, -69.50
X4, -18.15, -69.57
X5, -18.21, -70.24
X2276, -17.30, -69.30
X4, -18.01, -69.04
X4, -18.57, -68.59
X4, -19.25, -68.26
X4, -19.55, -68.31
X4, -20.24, -68.45
X4, -20.54, -68.33
X4, -21.18, -68.11
X4, -22.50, -67.53
X5, -22.49, -67.11
X2277, -22.49, -67.11
X4, -23.00, -67.00
X4, -24.01, -67.20
X4, -24.46, -68.34
X4, -25.07, -68.21
X4, -25.27, -68.36
X4, -26.09, -68.24
X4, -26.30, -68.35
X5, -27.03, -68.19
X4, -27.07, -68.49
X4, -28.24, -69.39
X4, -29.18, -70.02
X4, -30.11, -69.50
X5, -31.19, -70.34
X4, -33.10, -70.06
X4, -33.17, -69.48
X5, -34.14, -69.49
X4, -35.15, -70.34
X4, -36.03, -70.22
X4, -36.51, -71.11
X4, -38.34, -70.49
X4, -38.55, -71.24
X4, -39.35, -71.42
X4, -40.44, -71.57
X4, -42.06, -71.44
X5, -42.17, -72.08
X4, -43.01, -72.08
X4, -43.11, -71.44
X4, -43.55, -71.39
X4, -44.22, -71.51
X5, -44.32, -71.06
X4, -44.48, -71.17
X4, -44.46, -72.05
X4, -45.18, -71.18
X4, -45.39, -71.47
X4, -45.58, -71.36
X4, -46.41, -71.40
X4, -47.28, -72.22
X4, -48.48, -72.34
X5, -49.32, -73.35
X4, -50.45, -73.10
X4, -50.39, -72.18
X4, -51.34, -72.26
X5, -51.59, -71.56
X4, -52.00, -70.00
X5, -52.23, -68.26
X2278, -22.49, -67.11
X4, -22.14, -66.44
X5, -21.47, -66.14
X4, -22.07, -65.45
X4, -22.13, -64.36
X5, -22.52, -64.19
X5, -22.00, -63.56
X4, -22.00, -62.49
X5, -22.14, -62.38
X2279, -22.14, -62.39
X4, -23.49, -61.00
X4, -24.01, -60.02
X5, -25.11, -57.45
X4, -25.34, -57.34
X4, -26.11, -58.09
X5, -27.19, -58.36
X4, -27.35, -56.22
X4, -27.19, -56.09
X5, -27.17, -55.35
X4, -26.39, -54.48
X5, -25.34, -54.36
X2280, -22.14, -62.38
X4, -20.34, -62.16
X5, -19.39, -61.45
X4, -19.18, -59.59
X4, -19.37, -58.33
X4, -19.50, -58.09
X5, -20.10, -58.10
X2281, -10.57, -69.34
X4, -11.08, -68.45
X4, -10.57, -68.16
X4, -10.41, -67.42
X4, -9.54, -66.38
X5, -9.41, -65.26
X5, -10.55, -65.19
X4, -11.44, -65.12
X5, -12.28, -64.24
X4, -12.39, -63.04
X4, -13.01, -62.47
X4, -13.33, -61.50
X5, -13.48, -60.28
X4, -14.31, -60.20
X4, -15.06, -60.23
X4, -15.06, -60.34
X4, -15.29, -60.14
X5, -16.16, -60.10
X5, -16.17, -58.20
X4, -17.15, -58.24
X4, -17.36, -57.44
X5, -18.12, -57.27
X4, -19.44, -58.07
X4, -19.59, -57.51
X5, -20.10, -58.10
X2282, -20.10, -58.10
X4, -20.58, -57.49
X5, -22.05, -57.59
X4, -22.18, -56.50
X5, -22.17, -55.51
X5, -23.58, -55.24
X5, -24.03, -54.15
X5, -25.34, -54.36
X2283, -30.14, -57.38
X5, -32.27, -58.12
X2284, -30.14, -57.38
X4, -30.14, -56.38
X4, -31.05, -56.00
X4, -30.51, -55.37
X4, -31.05, -55.20
X5, -32.03, -53.45
X4, -32.43, -53.06
X4, -33.09, -53.31
X5, -33.45, -53.23
X2285, -25.34, -54.36
X4, -25.30, -54.06
X4, -25.41, -53.52
X4, -26.15, -53.39
X5, -27.08, -53.48
X4, -28.14, -55.46
X5, -30.15, -57.38
X2286, 1.57, -56.28
X4, 1.57, -55.55
X4, 2.16, -56.08
X4, 2.32, -55.58
X5, 2.20, -54.36
X2287, 2.20, -54.37
X4, 2.07, -54.07
X4, 2.22, -53.45
X4, 2.10, -52.58
X5, 2.20, -52.44
X5, 4.02, -51.41
X2288, 2.20, -54.36
X4, 3.27, -54.00
X4, 4.45, -54.29
X5, 5.21, -54.10
X2289, 5.12, -60.44
X4, 5.12, -60.06
X4, 4.31, -60.09
X5, 4.23, -59.40
X4, 3.56, -59.31
X4, 3.36, -59.51
X4, 2.41, -59.59
X4, 1.52, -59.45
X5, 1.23, -59.15
X4, 1.36, -58.19
X4, 1.31, -58.00
X4, 2.01, -57.06
X5, 1.57, -56.28
X2290, 1.13, -66.52
X4, 0.45, -66.19
X4, 0.59, -65.35
X4, 0.39, -65.31
X4, 1.15, -64.44
X4, 1.35, -64.07
X4, 1.57, -64.00
X5, 2.09, -63.24
X4, 2.25, -63.22
X4, 2.28, -64.02
X4, 3.36, -64.11
X5, 4.17, -64.48
X4, 3.53, -64.01
X4, 3.58, -63.21
X5, 3.34, -62.53
X4, 4.02, -62.45
X5, 4.16, -61.31
X4, 4.50, -60.39
X5, 5.12, -60.44
X2291, 11.51, -71.19
X4, 11.40, -71.59
X4, 11.07, -72.30
X5, 9.11, -73.23
X4, 9.07, -72.46
X4, 8.06, -72.20
X4, 7.29, -72.28
X5, 7.01, -72.00
X4, 6.59, -70.07
X4, 6.05, -69.15
X5, 6.12, -67.27
X4, 4.33, -67.53
X4, 3.24, -67.17
X5, 2.47, -67.51
X4, 2.24, -67.12
X5, 1.13, -66.52
X2292, 8.32, -59.59
X4, 8.14, -59.50
X4, 7.32, -60.43
X4, 7.03, -60.17
X4, 6.43, -61.08
X4, 6.11, -61.07
X5, 5.57, -61.23
X5, 5.12, -60.44
X2293, -4.13, -69.57
X4, -1.11, -69.23
X4, -0.31, -69.36
X4, -0.09, -70.03
X5, 0.35, -70.03
X5, 0.39, -69.07
X4, 1.02, -69.16
X4, 1.04, -69.51
X5, 1.43, -69.51
X4, 1.43, -68.09
X4, 2.01, -68.11
X4, 1.45, -67.55
X4, 2.09, -67.25
X4, 1.43, -67.06
X4, 1.10, -67.05
X5, 1.13, -66.52
X2294, 1.57, -56.28
X4, 2.51, -57.12
X4, 3.23, -57.18
X4, 3.23, -57.40
X5, 4.00, -58.03
X4, 4.50, -57.55
X4, 5.01, -57.17
X5, 5.29, -57.15
X2295, -52.39, -68.37
X5, -54.53, -68.38
X2296, 2.04, 109.39
X4, 1.37, 109.40
X5, 0.51, 110.34
X4, 1.00, 111.50
X4, 1.34, 112.29
X4, 1.13, 113.39
X4, 1.26, 114.34
X5, 2.04, 114.53
X4, 2.15, 114.49
X4, 2.31, 115.14
X4, 2.54, 115.09
X4, 3.10, 115.33
X4, 3.55, 115.34
X5, 4.22, 115.52
X5, 4.10, 117.36
X2297, 4.35, 114.05
X4, 4.01, 114.37
X4, 4.23, 114.53
X5, 4.52, 115.01
X2298, 4.49, 115.02
X4, 4.23, 115.06
X4, 4.20, 115.22
X5, 4.54, 115.09
X2299, -2.36, 141.00
X5, -9.08, 141.00
X4000, 46.00, -116.53
X4, 45.34, -122.15
X4, 45.51, -122.47
X4, 46.11, -123.05
X5, 46.17, -124.05
X4001, 42.00, -124.11
X5, 42.00, -120.00
X4002, 46.00, -116.53
X5, 49.00, -117.02
X4003, 42.00, -117.01
X4, 44.10, -116.53
X4, 44.29, -117.13
X4, 45.36, -116.27
X5, 46.01, -116.54
X4004, 42.00, -120.00
X5, 42.00, -117.01
X4005, 35.00, -114.37
X5, 39.00, -120.00
X5, 42.00, -120.00
X4006, 44.30, -111.03
X4, 44.45, -111.22
X4, 44.33, -111.28
X4, 44.29, -113.00
X4, 45.36, -113.48
X5, 45.34, -114.33
X4, 46.40, -114.19
X4, 47.26, -115.43
X5, 49.00, -116.03
X4007, 44.30, -111.03
X4, 45.00, -111.03
X5, 45.00, -104.00
X4008, 42.00, -111.03
X5, 44.30, -111.03
X4009, 42.00, -117.01
X5, 42.00, -114.02
X4010, 42.00, -114.02
X5, 42.00, -111.03
X4011, 37.01, -114.02
X5, 42.00, -114.02
X4012, 41.00, -109.03
X5, 41.00, -111.03
X5, 42.00, -111.03
X4013, 41.00, -109.03
X5, 41.00, -104.01
X4014, 37.00, -109.03
X5, 41.00, -109.03
X4015, 37.00, -114.03
X5, 37.00, -109.02
X4016, 37.00, -109.02
X5, 37.00, -103.00
X4017, 34.59, -114.37
X4, 36.05, -114.44
X4, 36.05, -114.07
X5, 37.01, -114.02
X4018, 32.43, -114.43
X4, 32.52, -114.27
X4, 33.18, -114.44
X4, 33.57, -114.31
X4, 34.17, -114.07
X5, 35.00, -114.37
X4019, 31.20, -109.03
X5, 37.00, -109.03
X4020, 45.56, -104.01
X5, 49.00, -104.02
X4021, 45.00, -104.00
X5, 45.57, -104.01
X4022, 45.56, -104.01
X5, 45.56, -96.33
X4023, 43.00, -104.02
X5, 45.00, -104.02
X4024, 41.00, -104.01
X5, 43.01, -104.02
X4025, 43.00, -104.02
X4, 42.48, -97.09
X5, 42.31, -96.28
X4026, 40.00, -102.01
X5, 41.00, -102.02
X5, 41.00, -104.01
X4027, 40.01, -102.01
X5, 37.00, -102.01
X4028, 37.00, -103.00
X5, 37.00, -102.00
X4029, 36.30, -103.00
X5, 37.00, -103.00
X4030, 31.47, -106.31
X4, 32.00, -106.40
X5, 32.00, -103.04
X5, 36.30, -103.00
X4031, 40.00, -102.01
X5, 40.00, -95.18
X4032, 37.00, -102.00
X5, 37.00, -94.37
X4033, 36.30, -103.00
X5, 36.28, -100.00
X4, 34.35, -100.00
X5, 34.13, -99.11
X4, 34.09, -98.06
X4, 33.53, -97.57
X4, 33.43, -97.08
X4, 33.58, -96.55
X4, 33.42, -96.19
X4, 33.57, -95.09
X5, 33.39, -94.29
X4034, 45.56, -96.34
X5, 49.00, -97.13
X4035, 43.30, -96.27
X4, 45.18, -96.27
X4, 45.36, -96.52
X5, 45.57, -96.33
X4036, 43.30, -96.26
X5, 43.30, -91.13
X4037, 42.31, -96.29
X5, 43.30, -96.27
X4038, 40.36, -95.46
X5, 42.31, -96.29
X4039, 40.37, -95.46
X5, 39.59, -95.18
X4040, 40.36, -95.46
X5, 40.23, -91.26
X4041, 37.00, -94.37
X4, 39.09, -94.36
X4, 39.33, -95.06
X4, 39.49, -94.53
X5, 40.00, -95.19
X4042, 36.30, -94.37
X5, 37.00, -94.37
X4043, 36.30, -94.37
X4, 36.25, -90.07
X4, 35.59, -90.23
X5, 36.00, -89.44
X4044, 33.39, -94.29
X5, 36.30, -94.37
X4045, 33.39, -94.30
X4, 33.33, -94.03
X5, 33.01, -94.03
X4046, 30.00, -93.48
X4, 31.02, -93.31
X4, 32.00, -94.03
X5, 33.01, -94.03
X4047, 33.01, -94.03
X5, 33.01, -91.11
X4048, 43.30, -91.13
X4, 43.58, -91.24
X5, 44.45, -92.49
X4, 45.43, -92.53
X4, 46.05, -92.18
X5, 46.46, -92.07
X4049, 42.30, -90.39
X4, 42.45, -91.04
X5, 43.31, -91.13
X4050, 40.23, -91.26
X4, 40.58, -90.57
X4, 41.25, -91.02
X4, 41.49, -90.12
X5, 42.31, -90.38
X4051, 46.35, -90.25
X4, 45.56, -88.07
X4051, 45.46, -87.54
X5, 45.06, -87.36
X4052, 42.29, -87.48
X5, 42.31, -90.38
X4053, 36.58, -89.07
X4, 37.16, -89.31
X4, 37.41, -89.32
X4, 38.14, -90.22
X4, 38.50, -90.08
X4, 38.53, -90.37
X4, 39.43, -91.23
X5, 40.23, -91.26
X4054, 41.43, -87.31
X4, 38.45, -87.31
X5, 37.48, -88.03
X4055, 37.49, -88.02
X4, 37.29, -88.05
X4, 37.04, -88.29
X5, 36.59, -89.08
X4056, 36.59, -89.08
X5, 36.29, -89.26
X4057, 36.30, -89.26
X5, 35.59, -89.44
X4058, 36.00, -89.44
X5, 35.00, -90.18
X4059, 35.01, -90.19
X4, 33.43, -91.14
X5, 33.00, -91.11
X4060, 33.01, -91.11
X4, 32.19, -90.54
X4, 31.38, -91.31
X5, 31.00, -91.39
X4, 30.59, -89.43
X5, 30.11, -89.31
X4061, 41.46, -86.50
X5, 41.41, -84.48
X4062, 41.44, -83.28
X5, 41.42, -84.48
X4063, 41.42, -84.48
X5, 39.06, -84.49
X4064, 39.06, -84.49
X4, 38.47, -84.48
X4, 38.44, -85.26
X4, 37.58, -86.03
X4, 38.12, -86.22
X4, 37.51, -86.38
X4, 37.58, -87.36
X5, 37.48, -88.03
X4065, 38.25, -82.36
X4, 38.45, -82.53
X4, 38.47, -84.05
X5, 39.05, -84.50
X4066, 37.32, -81.58
X5, 38.25, -82.35
X4067, 37.32, -81.58
X5, 36.36, -83.40
X4068, 36.30, -89.25
X4, 36.30, -88.03
X5, 36.36, -83.41
X4069, 36.36, -83.41
X5, 36.36, -81.39
X4070, 36.37, -81.39
X4, 36.08, -82.02
X4, 35.31, -83.53
X5, 34.59, -84.19
X4071, 35.00, -90.18
X5, 35.00, -88.11
X4072, 35.00, -85.37
X5, 35.00, -88.11
X4073, 35.00, -85.37
X5, 34.59, -84.19
X4074, 35.00, -88.11
X5, 30.23, -88.24
X4075, 30.16, -87.30
X5, 31.00, -87.36
X5, 31.00, -85.00
X4076, 30.59, -85.00
X4, 31.50, -85.08
X4, 32.16, -84.54
X5, 35.00, -85.37
X4077, 30.43, -81.31
X4, 30.43, -82.02
X4, 30.22, -82.05
X4, 30.34, -82.14
X4, 30.43, -84.52
X5, 31.00, -85.01
X4078, 40.38, -80.31
X5, 41.59, -80.31
X4079, 40.39, -80.31
X4, 39.37, -80.53
X4, 38.56, -81.46
X4, 38.56, -82.07
X5, 38.25, -82.36
X4080, 35.00, -83.06
X4, 34.42, -83.21
X4, 33.01, -81.29
X5, 32.02, -80.54
X4081, 34.59, -84.20
X5, 35.00, -83.06
X4082, 35.00, -83.06
X4, 35.13, -82.23
X4, 35.09, -81.03
X4, 34.48, -79.40
X5, 33.51, -78.33
X4083, 36.37, -81.40
X5, 36.33, -75.50
X4084, 39.20, -77.44
X4, 39.09, -77.50
X4, 39.20, -78.22
X4, 38.25, -79.17
X4, 38.35, -79.39
X5, 37.26, -80.27
X5, 37.32, -81.58
X4085, 39.43, -79.29
X4, 39.12, -79.29
X4, 39.42, -78.11
X5, 39.20, -77.44
X4086, 39.43, -79.29
X4, 39.43, -80.31
X5, 40.38, -80.31
X4087, 42.16, -79.46
X4, 42.00, -79.46
X4, 42.00, -75.20
X5, 41.21, -74.42
X4088, 41.21, -74.42
X4, 40.59, -73.54
X5, 40.30, -74.15
X4089, 42.03, -73.29
X5, 41.01, -73.39
X4090, 42.45, -73.15
X5, 42.03, -73.29
X4091, 42.03, -73.29
X5, 42.00, -72.47
X4092, 42.00, -72.48
X4, 42.00, -71.48
X5, 41.19, -71.51
X4093, 42.01, -71.48
X4, 42.01, -71.23
X5, 41.31, -71.08
X4094, 45.01, -73.21
X5, 42.45, -73.15
X4095, 42.44, -72.27
X5, 42.45, -73.15
X4096, 42.53, -70.49
END_OF_MWDBII.011
if test 12457 -ne `wc -c