Grads script to plot a lat/lon polygon

Jennifer Adams jma at COLA.IGES.ORG
Mon Oct 10 15:09:38 EDT 2005


Ben,
The basemap.gs script does something very similar to this. You can
modify that script to read your file instead and change the drawing
command a little, but just about all the components you need are there.
It won't determine the center for you, but you could save the min/max
values of lat/lon and figure it out inside your script.
Jennifer



On Oct 7, 2005, at 7:20 AM, Ben Burford wrote:

> 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
>
>
--
Jennifer Miletta Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
4041 Powder Mill Road, Suite 302
Calverton, MD 20705 USA
jma at cola.iges.org



More information about the gradsusr mailing list