<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I guess somewhat off topic for a devel list.... but my 02c<br><br>I'd use ogr2ogr to convert the shapefile to a GMT (Generic Mapping Tools) format vector file & use GMT to create the (COARDS compliant) netCDF grid file from the vector data.<br><br>GMT has several approaches possible, including triangulation, splines with tension, nearest neighbour, etc. You can use tools to convert polygons to grid values (much like gdalrasterize), or treat all the vertices as scattered point values...<br><br>If your global grid is also COARDS compliant, you can probably use GMT tools & some relatively simple scripting, to carry out the grid math/overlay operations as well.<br><br><br>Cheers,<br><br> Brent Wood<br><br>--- On <b>Tue, 5/29/12, Chao YUE <i><chaoyuejoy@gmail.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255);
margin-left: 5px; padding-left: 5px;"><br>From: Chao YUE <chaoyuejoy@gmail.com><br>Subject: [gdal-dev] how to convert shapefile to netcdf?<br>To: gdal-dev@lists.osgeo.org<br>Date: Tuesday, May 29, 2012, 5:16 AM<br><br><div id="yiv518788517">Dear all,<br><br>I have a shapefile of boreal foest (which further contains some ecoregion types) in North America and I want to like convert it to a NetCDF file (or numpy masked array) with a desired spatial resolution (let's say 0.5 degree) and then use this information to extract corresponding data from a global NetCDF file. I spent past two days trying to find information online but still have no clues. If anybody has done something similar, any hints or suggestions are greatly appreciated. Thanks a lot.<br>
<br>best regards,<br clear="all"><br>Chao<br>-- <br><div>***********************************************************************************</div>
<div>Chao YUE<br>Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)<br>UMR 1572 CEA-CNRS-UVSQ<br>Batiment 712 - Pe 119<br>91191 GIF Sur YVETTE Cedex</div>
<div>Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16<br></div>
<div>************************************************************************************</div><br>
</div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>gdal-dev mailing list<br><a ymailto="mailto:gdal-dev@lists.osgeo.org" href="/mc/compose?to=gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></div></blockquote></td></tr></table>