Grads script to plot a lat/lon polygon

Ben Burford benb at RESTEC.OR.JP
Fri Oct 7 07:20:47 EDT 2005


Hi,

I have a lot of polygons that define the locations of floods, and my basic t
ask here is to find the 1 degree by 1 degree grid cell in the center of the
polygon.  I will then look at the time series precipitation data in the prec
ipitation grid cell centered on the flood, during the flood.

I have data consisting of longitude latitude pairs that form a polygon (noti
ce that the values of the first and last pairs are the same) from the Dartmo
uth Flood Observatory data:

126.546702 7.555351
125.502037 7.781196
125.015046 7.423151
124.88223 7.065107
125.688528 6.242894
125.733699 6.921661
126.387476 6.662306
126.298932 7.020351
126.387476 7.244129
126.546702 7.555351

I could put these pairs of values in a separate (text) file for Grads to rea
d, I don't want to have to enter the values by hand if I can avoid it.

I would like Grads to read the pairs and plot the values on a 2D plot, where
 the plot is also overlaid by a 1 degree by 1 degree grid.

With the above I can eyeball the lat/lon of the center of the polygon.  Idea
lly, the script would also calculate the (approximate) center of the polygon
 for me (but this is optional).

As always, I really appreciate your help.

Ben



More information about the gradsusr mailing list