/**********************************************************************/ /* PLOT.C- plots a compressed coastline file */ #include #include /* map projection functions called */ void iproj(); void paspec(); void pdrnge(); void pmaplm(); /* graphics interface library functions called */ int ginit(); /* to initialize graphics mode */ int ggetlm(); /* to inquire screen dimensions */ int gsetco(); /* to set the color for coastline drawing */ int gterm(); /* to terminate graphics */ /* wdbplt functions called */ void wdbplt(); void main(void) { int iproj=1; float dxmin,dxmax,dymin,dymax; float pixaspect; float west=-90.,east=-80.,south=25.,north=35.; char ranks[63]={1,1,1,1,1,1,1}; short gap=1.; char coast_file[30]={"43wvs.dat"}; /* prompt for user inputs */ printf("Enter file spec for compressed coastline file to plot?\n"); scanf("%s",coast_file); printf("Enter limits of desired area. (floating point degrees)\n"); printf("South Latitudes negative, West longitudes negative.\n\n"); printf("Enter LONGITUDE for WEST edge of desired area?\n"); scanf("%f",&west); printf("Enter LONGITUDE for EAST edge of desired area?\n"); scanf("%f",&east); printf("Enter LATITUDE for SOUTH edge of desired area?\n"); scanf("%f",&south); printf("Enter LATITUDE for NORTN edge of desired area?\n"); scanf("%f",&north); /* initialize graphics */ ginit(); /* inquire graphics viewport resolution */ ggetlm(&dxmin,&dxmax,&dymin,&dymax); /* initialize map projection routine */ proj(&iproj); pdrnge(&dxmin,&dxmax,&dymax,&dymin); pmaplm(&west,&east,&south,&north); /* use coastline file spec as map title */ gtitle(coast_file); /* set color 15 (bright white) as coastline drawing color */ gsetco(15); /* now call the coastline extraction routine. It will call CURVE to do the actual plotting. */ wdbplt(coast_file,south,0.,north,0.,west,0.,east,0.,0.,ranks,gap); /* use keystroke to end the program */ while(!kbhit()); /* terminate graphics */ gterm(); }