[gradsusr] Plotting cities
Stephen McMillan
smcmillan at planalytics.com
Thu Apr 21 10:14:45 EDT 2016
Geoff,
Here's a short sample from a script that plots city location markers and
id's...
#Locations list:
loc.1='BOS -71.011 42.361';#locid lon lat
loc.2='PHL -75.23 39.868'
loc.3='ATL -84.427 33.64'
loc.4='ORD -87.914 41.986'
loc.5='DFW -97.019 32.898'
n=1;nlocs=5
while(n<=nlocs)
locid=subwrd(loc.n,1);lo=subwrd(loc.n,2);la=subwrd(loc.n,3)
'q w2xy 'lo' 'la
px=subwrd(result,3);py=subwrd(result,6)
'set line 1 1 1';#black mark when printim white
'draw mark 3 'px' 'py' 0.04';#closed circle/dot
'set strsiz 0.05';'set string 1 l 2';#black font when printim white
'draw string 'px+0.05' 'py+0.05' 'locid;#offset locid string from marker
n=n+1
endwhile
You would do above after displaying an appropriate variable on your desired
projection. You could also read in the location data from a text file,
e.g., one city per loop iteration:
while(....
data=read(citylist.txt)
locdata=sublin(data,2)
locid=subwrd(locdata,1);lo=subwrd(locdata,2);la=subwrd(locdata,3)
'q w2xy 'lo' 'la
etc.
Hope this helps...
Stephen McMillan
On Wed, Apr 20, 2016 at 5:01 PM, Geoff Fox <geoff.fox at gmail.com> wrote:
> I am looking for advice concerning GrADS maps with city names added. I've
> seen a number of solutions which require you to create a potential city
> list to plot. I'd like to use an existing city name database so I can
> enable this technique on-the-fly with different map projections/domains.
>
> Is there anyone who's done this and willing to share your technique?
>
> Thanks,
> Geoff Fox
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20160421/5c7640ad/attachment.html
More information about the gradsusr
mailing list