<div dir="ltr"><div>You could click "Functions" [Alphabetical]; then, search for the word 'area'<br></div>Keep clicking ....<br><div><br><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/area_poly_sphere.shtml">https://www.ncl.ucar.edu/Document/Functions/Built-in/area_poly_sphere.shtml</a><br><br></div><div>Also,<br><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/gc_qarea.shtml">https://www.ncl.ucar.edu/Document/Functions/Built-in/gc_qarea.shtml</a><br></div><div>See Examples<br><br></div><div>Good luck<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 12, 2018 at 8:14 AM, Vanúcia Schumacher <span dir="ltr"><<a href="mailto:vanucia-schumacher@hotmail.com" target="_blank">vanucia-schumacher@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">
<div id="m_-8478355152293599047divtagdefaultwrapper" style="font-size:14pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0;margin-bottom:0"></p>
<div>      Hi NCL users,</div>
<div>    
<div>I would like help to calculate the area from the shapefile.</div>
<div>Any ideas how can I proceed?</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>          hdr = readAsciiHead("inventory.asc", 7)</div>
<div>       ncols = stringtoint( str_get_field(hdr(0), 2, " ") )</div>
<div>      nrows = stringtoint( str_get_field(hdr(1), 2, " ") )</div>
<div>       lonLL = stringtofloat( str_get_field(hdr(2), 2, " ") )</div>
<div>        latLL = stringtofloat( str_get_field(hdr(3), 2, " ") )</div>
<div>  deltaLon = stringtofloat( str_get_field(hdr(4), 2, " " ) )</div>
<div>  deltaLat = stringtofloat( str_get_field(hdr(5), 2, " ") )</div>
<div>missingVal = stringtofloat( str_get_field(hdr(6), 2, " ") )</div>
<div><br>
</div>
<div>data           = readAsciiTable("inventory.asc"<wbr>,ncols,"float",7) </div>
<div>                     data@_FillValue =-9999.0</div>
<div><br>
</div>
<div>;----- construct 1D coordinates....</div>
<div>lons             = ispan(0,ncols-1,1) * deltaLon + lonLL</div>
<div>lats             = ispan(0,nrows-1,1) * deltaLat + latLL</div>
<div>lats             = lats(::-1)</div>
<div><br>
</div>
<div>;---- gsn_coordinates wants 2D coordinate arrays</div>
<div>data@lon2d       = conform_dims((/ nrows, ncols/), lons, 1)</div>
<div>data@lat2d       = conform_dims((/ nrows, ncols/), lats, 0)</div>
<div>data@_FillValue  = missingVal</div>
<div><br>
</div>
<div>;---- Open shapefile and read lat/lon values.</div>
<div><br>
</div>
<div>shp_filename    =  "Cuenca_Universidad.shp" </div>
<div>data_mask       = shapefile_mask_data(data,shp_<wbr>filename,True)</div>
<div><br>
</div>
<div>;--- Area ?</div>
<br>
<p></p>
</div>
</div>

<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>