<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" 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",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_filename,True)</div>
<div><br>
</div>
<div>;--- Area ?</div>
<br>
<p></p>
</div>
</body>
</html>