<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Actually, point shapefiles are naturally suited to the GrADS station data interface, and I have already written a short C program that will convert a point shapefile to a GrADS station data set. I would be happy to share this code if anyone is interested. But this is an external utility, and there are no plans to integrate it into GrADS.&nbsp;<div><br></div><div>The idea of using a polygon in a shape file to define an area to mask out a gridded data set would be a useful feature; however, this is done very easily by the GIS tools, and we have no plans or funding to implement this in GrADS. It's possible to kludge it with manual interactive scripting using 'q pos' to click on grid points that you decide are in/outside of a polygon, but this is not practical for high res data or a large number of polygons.</div><div><br></div><div>--Jennifer</div><div><br><div><br><div><div>On Jun 30, 2011, at 1:23 PM, Huddleston, John wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Yaqiang<br><br>It would be better to develop a utility outside of GrADS for that purpose.<br><br>Point shapefiles would translate best to gridded data; however there is a certain amount of work to define the outside "-1" area, the simplest would be a box.<br><br>Line shapefiles would involve using an intersection algorithm and the user would have to specify the grid size and the starting corner coordinates.<br><br>A polygon, or multipolygon, shapefile can be quite complex. Reverse direction is the "donut hole" of '-1' values and normal direction are the '1' values. Again, there would have to be a grid specification and intersection.<br><br>Frank Warmerdam's FWTools2.4.7 has a shp2img utility. I've not used it; however, the output can be one of the GDAL formats.<br><br>Again, this type of utility is not suited for GrADS, IMHO.<br><br>John Huddleston, PhD<br>Cooperative Institute for Research in the Atmosphere <br><br>-----Original Message-----<br>From: gradsusr-bounces@gradsusr.org [<a href="mailto:gradsusr-bounces@gradsusr.org">mailto:gradsusr-bounces@gradsusr.org</a>] On Behalf Of Yaqiang Wang<br>Sent: Thursday, June 30, 2011 8:40 AM<br>To: GrADS Users Forum<br>Subject: Re: [gradsusr] Info about shape files<br><br>Dear Jennifer Adams,<br><br>Maybe you could consider to develop a function to convert polygon shapes to gridded data with the inside values as 1 and outside values as -1. Then the gridded data could be used in the analysis functions.<br><br>Best Regards!<br>Yaqiang Wang<br><br>**************************************************<br>Dr. Yaqiang Wang<br>Chinese Academy of Meteorological Sciences (CAMS) 46, Zhong-Guan-Cun South Avenue Beijing, 100081 China<br>              <br><a href="mailto:yaqiang.wang@gmail.com">yaqiang.wang@gmail.com</a><br>***************************************************<br>2011-06-30<br><br>======= 2011-06-29 18:17:06 In your letter:=======<br><br><blockquote type="cite">A shapefile is a set of points, lines, or polygons, not gridded data, <br></blockquote><blockquote type="cite">and there is no way to use the analysis functions in GrADS on the <br></blockquote><blockquote type="cite">graphical elements in a shapefile. --Jennifer<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On Jun 29, 2011, at 5:51 AM, Francesco Piani wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">Thanks for the reply.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">But MeteoInfo seems to be a different tool than GrADS. I wonder if &nbsp;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">GrADS can use shape also for maskout or other statistical operations.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Francesco<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Da: "Yaqiang Wang" &lt;yaqiang.wang@gmail.com&gt;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">A: "piani" &lt;piani@lamma.rete.toscana.it&gt;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Inviato: Martedì, 28 giugno 2011 16:04:14<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Oggetto: Re: [gradsusr] Info about shape files<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Hi Francesco,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">1. Shape files could be used as maskout layer in MeteoInfo which is &nbsp;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">free avaliable at http://www.esnips.com/web/MeteoInfo . You can even &nbsp;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">use one or more shapes in a shape file as maskout through output the &nbsp;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">shapes to a .wmp file. In this way, the plot will be masked exactly &nbsp;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">by the border lines of the shapes.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">2. With MeteoInfo, you can output the shapes of a shape file to a &nbsp;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">maskout grid data which could be used in maskout() function of GrADS.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">The detailed information could be found in the help document of &nbsp;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">MeteoInfo. Only polygon shape files are valid for above application.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Best Regards!<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Yaqiang Wang<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">**************************************************<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Dr. Yaqiang Wang<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Chinese Academy of Meteorological Sciences (CAMS)<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">46, Zhong-Guan-Cun South Avenue<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Beijing, 100081<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">China<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">              <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">yaqiang.wang@gmail.com<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">***************************************************<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">2011-06-28<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">======= 2011-06-28 18:17:36 In your letter:=======<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Hi all.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">I'm working with shapefiles and I would like to know if it's &nbsp;<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">possible to use them for other operations than draw and write. In &nbsp;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">particular, is there a way to use with maskout()?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Thanks in advance.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Francesco<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">_______________________________________________<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">gradsusr mailing list<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">gradsusr@gradsusr.org<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">http://gradsusr.org/mailman/listinfo/gradsusr<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">= = = = = = = = = = = = = = = = = = = =<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">_______________________________________________<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">gradsusr mailing list<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">gradsusr@gradsusr.org<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">http://gradsusr.org/mailman/listinfo/gradsusr<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">--<br></blockquote><blockquote type="cite">Jennifer M. Adams<br></blockquote><blockquote type="cite">IGES/COLA<br></blockquote><blockquote type="cite">4041 Powder Mill Road, Suite 302<br></blockquote><blockquote type="cite">Calverton, MD 20705<br></blockquote><blockquote type="cite">jma@cola.iges.org<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">gradsusr mailing list<br></blockquote><blockquote type="cite">gradsusr@gradsusr.org<br></blockquote><blockquote type="cite">http://gradsusr.org/mailman/listinfo/gradsusr<br></blockquote><blockquote type="cite"><br></blockquote><br>= = = = = = = = = = = = = = = = = = = =<br><br>_______________________________________________<br>gradsusr mailing list<br>gradsusr@gradsusr.org<br>http://gradsusr.org/mailman/listinfo/gradsusr<br><br>_______________________________________________<br>gradsusr mailing list<br>gradsusr@gradsusr.org<br>http://gradsusr.org/mailman/listinfo/gradsusr<br></div></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>--</div><div>Jennifer M. Adams</div><div>IGES/COLA</div><div>4041 Powder Mill Road, Suite 302</div><div>Calverton, MD 20705</div><div><a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span></div></span> </div><br></div></div></body></html>