<div dir="ltr">Hi Rick and Dave,<div><br></div><div>Thanks for replying. I've uploaded the shapefile to the ftp site. It's a very simple one, with "x" and "y" and "COMID" (and some other variables) being its variables. </div>
<div><br></div><div>If I used "X = f->x", and print(X), all the values can be correctly read. But when I used "COMIDs = f->COMID", it just simple read as value "0". Looks forward to your reply.</div>
<div><br></div><div>Peirong</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 5, 2014 at 3:25 PM, Dave Allured - NOAA Affiliate <span dir="ltr"><<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</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">Never mind, it looks like you already used one of the print statements to find that COMID is a defined file variable.<span class="HOEnZb"><font color="#888888"><div>
<br></div></font></span><div><span class="HOEnZb"><font color="#888888">--Dave</font></span><div><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 5, 2014 at 3:19 PM, Dave Allured - NOAA Affiliate <span dir="ltr"><<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><span style="font-family:arial,sans-serif;font-size:14px">Peirong,</span><br>
<div><span style="font-family:arial,sans-serif;font-size:14px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:14px">You should start debugging something like this with printVarSummary (f) and print(f), not getfilevarnames (f).</span></div>
<div><span style="font-family:arial,sans-serif;font-size:14px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:14px">--Dave</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Aug 5, 2014 at 3:13 PM, Peirong Lin <span dir="ltr"><<a href="mailto:peironglinlin@gmail.com" target="_blank">peironglinlin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">Dear NCL,<div><br></div><div>I am using the following NCL code to read a shapefile attribute table (which allows further computation), but when I printed out all the "COMIDs", they are all "0". But when I open the shapefile in ArcGIS, the COMIDs can be correctly shown. Can anybody provide some hints to resolve this? </div>
<div><br></div><div><b>begin<br></b></div><div>
<p><b>shp_file = "./NHDFlowline.shp"</b></p>
<p><b>f = addfile(shp_file,"r")</b></p>
<p><b>varnames = getfilevarnames(f)</b></p>
<p><b>print("varnames = "+varnames)</b></p>
<p><b>COMIDs = f->COMID</b></p>
<p><b>print(COMIDs)</b></p>
<p><b>end</b></p></div><div><br></div><div>I've already made sure the COMID is a variable in the shapefile, but the values just cannot be read correctly. Thank you in advance for replying!!</div><div><br></div>
<div>Best,</div><div>Peirong</div><span><font color="#888888"><div><br clear="all"><div><br></div>-- <br><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><div style="color:rgb(255,102,0)">
<b>Peirong Lin</b> (Ms.)<br>
Graduate Research Assistant <span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse;color:rgb(204,102,0)">(JGB 5.322)</span></span><br>
Jackson School of Geosciences</div><div><font color="#ff6600">The University of Texas at Austin</font><br><font color="#ff6600">Contact: <a href="tel:512-201-3731" value="+15122013731" target="_blank">512-201-3731</a> </font><br>
<a href="mailto:prlin@utexas.edu" style="color:rgb(255,102,0)" target="_blank">prlin@utexas.edu</a><font color="#ff6600">; </font><a href="mailto:peironglinlin@gmail.com" style="color:rgb(255,102,0)" target="_blank">peironglinlin@gmail.com</a><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"></span></div>
</span>
</div></font></span></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><div style="color:rgb(255,102,0)"><b>Peirong Lin</b> (Ms.)<br>Graduate Research Assistant <span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse;color:rgb(204,102,0)">(JGB 5.322)</span></span><br>
Jackson School of Geosciences</div><div><font color="#ff6600">The University of Texas at Austin</font><br><font color="#ff6600">Contact: 512-201-3731 </font><br><a href="mailto:prlin@utexas.edu" style="color:rgb(255,102,0)" target="_blank">prlin@utexas.edu</a><font color="#ff6600">; </font><a href="mailto:peironglinlin@gmail.com" style="color:rgb(255,102,0)" target="_blank">peironglinlin@gmail.com</a><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"></span></div>
</span>
</div>