need help (regional boundary)

J M jemz57 at YAHOO.COM
Thu Jul 6 11:21:29 EDT 2006


Hello Alessandro,

Here is a simple script snippet that you can put in a
grads script that will draw a boundary using a lonlat
coordinate pairs from an ascii file. It is not elegant
code, but it works.
The lonlatfile format is one lon/lat coordinate pair
on each line. Maxpts is the total number of coordinate
points. If you  want a closed boundary, make the last
coordinate pair in the ascii file the same as the
first coordinate pair.
------------------------------------------------
*Read lon lat coords of boundary points,calculate xy
coords and plot points

count = 1
while (count<=maxpts)
  llpoint= sublin(read(lonlatfile),2)

  ln = subwrd(llpoint,1)

  lt = subwrd(llpoint,2)

  'q w2xy 'ln' 'lt''

  x1=subwrd(result,3)
  y1=subwrd(result,6)

if count=1
  oldx=x1
  oldy=y1
else
  'draw line 'oldx' 'oldy' 'x1' 'y1''
endif
  oldx=x1
  oldy=y1
  count=count+1
endwhile

--------------------------------------------------
This might work for your purposes.

Regards,
Joe Marlow
Tohono O'odham Community College
jmarlow at tocc.cc.az.us
jemz57 at yahoo.com


--- Alessandro Raolil <raolil at LE.ISAC.CNR.IT> wrote:

> Hi Francis,
> i have the same problem of Vikram, but for italian
> regions. Can you send
> me the correct code? i have all the lon/lat
> coordinates in ascii format.
> Thanks
> Alessandro
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com



More information about the gradsusr mailing list