[ncl-talk] maximum point in a shapefile

Ehsan Taghizadeh ehsantaghizadeh at yahoo.com
Wed Feb 5 14:52:49 MST 2020


Dears,
I hope you're doing great.
I found "shapefiles_13.ncl" and it seems a very useful script. It helps if I want to distinguish each county with the average. But what about if I just want to plot the maximum point in each county. I mean how I could plot just one point in each county which is the maximum point of that county.Obviously, I need the following change in "shapefiles_13.ncl"data_avg(i)  = avg(where(data_mask_1d.eq.1,data_1d,data_1d at _FillValue))todata_max(i)  = max(where(data_mask_1d.eq.1,data_1d,data_1d at _FillValue))I think with finding the index of the maximum point I could locate that in the plot with the following line (from minmax_4.ncl):gsn_add_polymarker(wks,plot,sst&lon(max_ii at xi),sst&lat(max_ii at yi),mkres)
So, how could I find the index of "dax_max(i)". It seems the following line could not be helpful for a script like "shapefiles_13.ncl":

 max_ii = ind(data_max(i))
The summary of my question is that I need some help to find the maximum point in each geometry of a shapefile and I'll be thankful if I hear from you. Should I give up "shapefiles_13.ncl" and try with "shapefile_mask_data"?

SincerelyEhsan TaghizadehInstitute of Geophysics, University of Tehran, Iran
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200205/ae6b129b/attachment.html>


More information about the ncl-talk mailing list