************************************************************************ *City plotter *Dan Leins - NWS WFO Cleveland, OH *Script adapted from work by M. Mahakur - FRD,Indian Institute of Tropical Meteorology, Pune *Sep 17 2009 *To mark station locations in a map *Filename "cities.txt" contains the positions (lat, lon, cityname) ************************************************************************* ******************************************************************************* *Open the list of cities cities = cities.txt *start the while loop which reads all the points from the cities.txt file start=0 while(start<100) say 'start is 'start ret = read(cities) rc = sublin(ret,1) if (rc>0) if (rc!=2) say 'File I/O Error' return endif break endif rec = sublin(ret,2) lat.start=subwrd(rec,1) lon.start=subwrd(rec,2) site.start=subwrd(rec,3) say 'lat is 'lat.start' lon is 'lon.start' and the city is 'site.start start=start+1 endwhile last_city=start-1 say 'last city is 'last_city *This is the section where we actually plot the cities start=0 while (start <=last_city) 'q w2xy 'lon.start' 'lat.start xx.start=subwrd(result,3) yy.start=subwrd(result,6) *Mark each point with a period say 'This means x is 'xx.start' and y is 'yy.start 'set string 0 c 10 0' 'set strsiz 0.3' 'draw string 'xx.start' 'yy.start' .' *Now label each period with the city name - the name is placed above the period 'set string 0 tc 5 0' 'set strsiz 0.10' 'draw string 'xx.start+0.1' 'yy.start+0.1' 'site.start'' start=start+1 endwhile