func load_map ( ffn= ) { /* DOCUMENT load_map(ffn=) Load a NOAA/USGS geographical coastline lat/lon map into the present window. This is useful if you want to project some GPS positions onto a map easily. Yorick lets you quickly and easily pan and zoom on the map and your data. Get the maps from: http://crusty.er.usgs.gov/coast/getcoast.html Use the "mapgen" format option. After you download the map, remove the first line (which is a comment beginning with a # sign). This function expects the map files to end with a .amap extension. This function uses sel_file to solicite a filename from the user. C. W. Wright wright@web-span.com 99-03-20 See also: sel_file */ extern map_path if ( is_void( map_path ) ) { // Set the following to where the maps are stored on your system. map_path = "/home/wright/maps" } if ( is_void( ffn ) ) { ffn = sel_file(ss="*.amap", path="/home/wright/maps/") (1); } f = open(ffn, "r" ); lsegs = 0 str = array(string,1); lat = array(float, 1000) lon = array(float, 1000) if (catch(0x02) ) { close,f return; } // load upto 100,000 line segments for (i=0; i<100000; i++) { n = read(f,format="%f %f", lon,lat) if ( n == 0 ) { close,f write,i," line segments loaded" return; } n = n/2 lsegs++ if ( lat(1) == 0 ) break; if ( (i % 1000) == 0 ) { print,i redraw } plg,lat(1:n),lon(1:n),marks=0 gridxy,1,1 } n=write(format="%d line segments read from %s\n", lsegs, fn) close,f }