[ncl-talk] Unable to read shapefile attribute table correctly

Rick Brownrigg brownrig at ucar.edu
Wed Aug 6 12:06:35 MDT 2014


Hi Peirong,


The problem turns out to be an unfortunate bug in handling 3D shapefiles
(your data are perhaps the first 3D shapefile I've encountered).  The bug
has been fixed and should be available in an upcoming 6.2.1 release of
NCL.  We'll work with you to try to get you a fixed binary in the meantime.

Thanks for your help in pointing out the issue and providing an example!

Rick


On Wed, Aug 6, 2014 at 10:11 AM, Peirong Lin <peironglinlin at gmail.com>
wrote:

> Thanks anyway! Hope to hear from you soon.
>
> Best,
> Peirong
>
>
> On Wed, Aug 6, 2014 at 9:50 AM, Rick Brownrigg <brownrig at ucar.edu> wrote:
>
>> Hi Peirong,
>>
>> I am looking into this issue with the files you sent.  This appears to be
>> a serious bug somewhere, but I as of yet can not tell where it is
>> originating.  I've verified separately, using GDAL utilities, that the
>> COMID field is indeed non-zero.  I will post an update on progress later,
>> but this may take much time to track down.
>>
>> Rick
>>
>>
>>
>> On Tue, Aug 5, 2014 at 3:23 PM, Rick Brownrigg <brownrig at ucar.edu> wrote:
>>
>>> Hi Peirong,
>>>
>>> Are you able to share those shapefiles, and if so, would you mind
>>> sending them to me?  If they are too big to be emailed, there's our ftp
>>> site:
>>>
>>> http://ncl.ucar.edu/report_bug.shtml
>>>
>>> Thanks,
>>> Rick
>>>
>>>
>>>
>>> On Tue, Aug 5, 2014 at 3:13 PM, Peirong Lin <peironglinlin at gmail.com>
>>> wrote:
>>>
>>>> Dear NCL,
>>>>
>>>> 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?
>>>>
>>>>
>>>> *begin*
>>>>
>>>> *shp_file        = "./NHDFlowline.shp"*
>>>>
>>>> *f       = addfile(shp_file,"r")*
>>>>
>>>> *varnames        = getfilevarnames(f)*
>>>>
>>>> *print("varnames = "+varnames)*
>>>>
>>>> *COMIDs  = f->COMID*
>>>>
>>>> *print(COMIDs)*
>>>>
>>>> *end*
>>>>
>>>> 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!!
>>>>
>>>> Best,
>>>> Peirong
>>>>
>>>>
>>>> --
>>>> *Peirong Lin* (Ms.)
>>>> Graduate Research Assistant (JGB 5.322)
>>>> Jackson School of Geosciences
>>>> The University of Texas at Austin
>>>> Contact: 512-201-3731
>>>> prlin at utexas.edu; peironglinlin at gmail.com
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>>>
>>>
>>
>
>
> --
> *Peirong Lin* (Ms.)
> Graduate Research Assistant (JGB 5.322)
> Jackson School of Geosciences
> The University of Texas at Austin
> Contact: 512-201-3731
> prlin at utexas.edu; peironglinlin at gmail.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140806/6fe4b715/attachment.html 


More information about the ncl-talk mailing list